少了括号
f.getContentPane().add(new initarray("Hello Java!"));
f.getContentPane().add(new initarray("Hello Java!"));
解决方案 »
- C#改java,应该不难吧,帮个忙,谢谢
- 关于JAVA中判断特定位置后面的字符串的问题
- 如何用Junit测试读取properties文件的类? 谢谢~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- java如何進行簡體字和繁體字的转换?我的程序為什麼不行?
- 在标签中显示图片 初学者请教!!!
- 刚学java,这些错误的提示是表示什么意思?
- 用java做系统服务!高手请进!
- [初学请教]
- 你们都用哪种开发软件啊,,
- 紧急求助!谁熟悉websphere的配置?或关于webshpere好的网站!
- java命令不能执行,而javac可以执行,真是奇怪
- 在Applet上添加的按钮如何显示ImageIcon?-高手请详细解答!
{
theMessage = message;
theButton = new JButton("按钮");
getContentPane().setLayout (new FlowLayout());
getContentPane().add(theButton);
theButton.addActionListener(this);
addMouseMotionListener(this);
}f.getContentPane().add(new initarray("Hello Java!"));
俺没看到什么高级的效果哦,好菜~~~~~~~~~~~
我用的是j2sdk1.4.1_01。
修改如下:public initarray(String message)
{
theMessage = message;
theButton = new JButton("按钮");
getContentPane().setLayout (new FlowLayout());
getContentPane().add(theButton);
theButton.addActionListener(this);
addMouseMotionListener(this);
}
我怎么不行啊。
载入:无法实例化 initarray.class。
java.lang.InstantiationException: initarray
at java.lang.Class.newInstance0(Class.java:281)
at java.lang.Class.newInstance(Class.java:249)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:548)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:477)
at sun.applet.AppletPanel.run(AppletPanel.java:290)
at java.lang.Thread.run(Thread.java:536)