import java.awt.*;
import java.awt.event.*;
public class ApplicationGraphicsInOut
{
public static void main(String args[])
{
new FrameInOut();
}
}
class FrameInOut extends Frame implements ActionListener
{
Label prompt;
TextField input,output;
FrameInOut()
{
super("图形界面 java application 程序 ");
prompt =new Label("请输入您的名字: ");
input =new TextField(6);
output =new TextField(20);
setLayout(new FlowLayout());
add(prompt);
add(input);
add(output);
input.addActionListener(this);
setSize(300,200);
show();
}
public void actionPerformed(ActionEvent e)
{
output.setText(input.getText()+",欢迎您 ");
}
}上面的代码错在那里?另外jdk_6_rc_bin_b66_windows_i586_05_jan_2006.exe版本和以前的有区别吗?我们学校用以前的教材,我运行书上例题也会出错?
import java.awt.event.*;
public class ApplicationGraphicsInOut
{
public static void main(String args[])
{
new FrameInOut();
}
}
class FrameInOut extends Frame implements ActionListener
{
Label prompt;
TextField input,output;
FrameInOut()
{
super("图形界面 java application 程序 ");
prompt =new Label("请输入您的名字: ");
input =new TextField(6);
output =new TextField(20);
setLayout(new FlowLayout());
add(prompt);
add(input);
add(output);
input.addActionListener(this);
setSize(300,200);
show();
}
public void actionPerformed(ActionEvent e)
{
output.setText(input.getText()+",欢迎您 ");
}
}上面的代码错在那里?另外jdk_6_rc_bin_b66_windows_i586_05_jan_2006.exe版本和以前的有区别吗?我们学校用以前的教材,我运行书上例题也会出错?
解决方案 »
- 求正则,取出一段文字中除了<img />标签以为的所有内容,谢谢
- 关于擦出的补偿问题
- 用java的参加软件设计师考试,行吗?
- 新手请教:在javac时 出现HelloWorld.java 使用或覆盖了已过时的API
- JComboBox内容显示有时候不出来怎么办啊
- 数据库连接问题
- 菜鸟问题:怎样截取字符串?
- Jbuilder 5.0中的调试,我设好了断点,为什么有时候断点上打个叉,有时候打个勾,代表什么?
- 怎样在小程序里做个表格?
- 我在JBUILDER4中作的APPLET,离开IDE环境在IE中不能启动,为什么?
- 各位高手进~~~小弟我想做个站内搜索!哪位高手给指点下思路~??
- 在LINUX下对文件的操作问题!
super("图形界面 java application 程序 ");