java 导入包 未使用_java导入的包无法使用

代码如下:importjavax.swing.JButton;importjavax.swing.JFrame;importjavax.swing.JOptionPane;importjavax.swing.JPanel;importjavax.swing.JTextField;importjavax.swing.text.Vi...

代码如下:

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JOptionPane;

import javax.swing.JPanel;

import javax.swing.JTextField;

import javax.swing.text.View;

import org.omg.CORBA.PUBLIC_MEMBER;

import com.sun.java.swing.plaf.windows.resources.windows;

import sun.awt.WindowClosingListener;

import sun.security.jgss.LoginConfigImpl;

public class MAIN

{

String usertext,passwordtext;

TextField user,password;

JFrame frame = new JFrame();

JPanel panel = new JPanel();

JButton button1=new JButton("登陆");

JButton button2=new JButton("重置");

Label label1 = new Label("账号:",Label.RIGHT);

Label label2 = new Label("密码:",Label.RIGHT);

MAIN(){

button1.addActionListener(new ActionListener()

{

public void actionPerformed(ActionEvent e)

{

if(e.getSource()==button1){

try

{

new Mysql1();

frame.setVisible(false);

} catch (SQLException e1)

{

e1.printStackTrace();

}

}

}

});

user = new TextField(12);

password = new TextField(8);

usertext=user.getText();

passwordtext=password.getText();

password.setEchoChar('*');

panel.add(label1);

panel.add(user);

panel.add(label2);

panel.add(password);

panel.add(button1);

panel.add(button2);

frame.add(panel);

frame.setLayout(new FlowLayout());

frame.setTitle("系统管理员登陆界面");

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setBounds(500,150, 500, 500);

frame.setVisible(true);

}

public static void main(String[] args)

{

MAIN main = new MAIN();

}

}

我导入了rt.jar这个包,可还是报错说访问限制:由于对必需的库 C:\Program Files\Java\jre7\lib\rt.jar 具有一定限制,因此无法访问类型 JPanel?

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值