帮忙改错???不明白呀!!! class LoginDialog does not have a constructor which takes no parameters, since there is a LoginDialog(JFrame parent) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果要写一个LoginDialog class的测试程序,应该怎么写?我还需要加什么method在test里面吗?? tryclass test { static JFrame f; public static void main(String[] args) { f = new JFrame("This is a test"); f.setSize(400, 150); Container content = f.getContentPane(); content.setBackground(Color.white); content.setLayout(new FlowLayout()); JButton jb = new JButton("Click Me"); jb.addActionListener(new ActionListener() { public void actionPerformed ( ActionEvent ae ) { LoginDialog ld = new LoginDialog(f); ld.userText = new JTextField("zongyi"); ld.pwText = new JPasswordField("zongyi"); ld.show(); } }); content.add(jb); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent event) { System.exit(0); } }); f.setVisible(true); } } LOGINDIALOG里面没有无参数的构造函数,你改一下好了,或者在调用上改,或者在类里改,都可以 猴子吃桃 如何写自定义的事件监听接口 JPanel绘制图片延时的问题,郁闷了好久 新手问个问题,答对就给分! 我想在JSP页中显示存储在ORACLE数据库中的图片,500分! 大哥们帮帮忙 活不了拉 55555 请教一个简单程序的源代码 《Java2面向对象编程指南》这本书怎么样? 把JtextArea加入JSrollPane后,产生滚动条后,如何让textArea总是显示上面的部分。 线程死锁。请前辈帮忙看一下。 请问java怎么实现传递引用? 大哥大姐,小弟想知道那里有支持JAVA的免费服务器啊??
class test
{
static JFrame f;
public static void main(String[] args)
{ f = new JFrame("This is a test");
f.setSize(400, 150);
Container content = f.getContentPane();
content.setBackground(Color.white);
content.setLayout(new FlowLayout());
JButton jb = new JButton("Click Me");
jb.addActionListener(new ActionListener() {
public void actionPerformed ( ActionEvent ae )
{
LoginDialog ld = new LoginDialog(f);
ld.userText = new JTextField("zongyi");
ld.pwText = new JPasswordField("zongyi");
ld.show();
} }); content.add(jb);
f.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent event)
{
System.exit(0);
}
}); f.setVisible(true);
}
}
你改一下好了,或者在调用上改,或者在类里改,都可以