构造方法不能有返回值,所以找不到构造方法了,
去掉void
public face()
public actionbutton()
去掉void
public face()
public actionbutton()
解决方案 »
- swing 引用文字编辑器
- 大家帮忙看看这道scjp题吧
- 迷茫,请各位的大侠赐教
- 用socket client端 发给socket服务器,服务器检查终端的连线状态,怎么一直是离线状态?
- 请教!java里面如何得到gif图片的帧数?
- Content-Type问题
- java中socket服务端同时对连接中客户端下发数据方法
- 请教一下那里有好点的jsp 的论坛和网站
- 将int型数据a转换为String的话,使用String.valueOf(a)和(new Integer(a)).toString()这2中方法有什么区别?
- 程序中如何取得当前 JBuilder 的版本号?
- 请问各位,哪里能找到ftpClient.class的源代码,究竟放在什么地方???
- servlet如何取jsp中的参数?
private int num;
public void actionbutton(){
num=0;
}
public void actionPerformed(ActionEvent e){
num++;
Object o=e.getSource();
String numstr=Integer.toString(num);
if(o instanceof Button)
{
Button b=(Button) o;
b.setLabel(numstr);
};
}
}
public static void main(String args[])
{
System.out.println("1111");
face f=new face();
}
}
public static class face extends JPanel{
private JButton jButton1 = new JButton();
private JTextField jTextField1 = new JTextField();
public void face()
{
System.out.println("2222");
jButton1.setBounds(new Rectangle(119, 22, 113, 35));
jButton1.setText("count");
this.setLayout(null);
jTextField1.setText("0");
jTextField1.setBounds(new Rectangle(96, 88, 284, 36));
this.add(jButton1, null);
this.add(jTextField1, null);
System.out.println("3333");
actionbutton ab=new actionbutton();
jButton1.addActionListener(ab);
System.out.println("4444");
}
}