当前位置: 代码迷 >> Java相关 >> 刚学awt就有问题了,各位帮指点下?
  详细解决方案

刚学awt就有问题了,各位帮指点下?

热度:142   发布时间:2006-12-15 22:57:30.0
刚学awt就有问题了,各位帮指点下?
/* date from 2006.12.15*/
import java.awt.*;
import java.awt.event.*;
public class trans
{
public static void main(String argv[])
{
Frame f=new Frame("窗口");
TextField t=new TextField("文本区",12);
Button b=new Button("按钮");
f.setLayout(new BorderLayout(30,20));
f.add(t,BorderLayout.NORTH);
f.add(b,BorderLayout.CENTER);
f.addWindowListener(new W());
f.setSize=(300,100);
f.setResizable(false);
f.setVisible(true);
}
}
class W implements WindowListener
{
public void windowOpened(WindowEvent e){};
public void windowClosing(WindowEvent e){System.exit(0);};
public void windowClosed(WindowEvent e){};
public void windowIconified(WindowEvent e){};
public void windowDeiconified(WindowEvent e){};
public void windowActivated(WindowEvent e){};
public void windowDeactivated(WindowEvent e){};
}
搜索更多相关的解决方案: awt  

----------------解决方案--------------------------------------------------------

你的问题呢?  就帖个代码上来认人怎么帮?


----------------解决方案--------------------------------------------------------
真是郁闷,这一句是什么啊??f.setSize=(300,100);
怎么多了个等号
----------------解决方案--------------------------------------------------------
哈哈,多谢楼上,一下弄到点子上了。
----------------解决方案--------------------------------------------------------

----------------解决方案--------------------------------------------------------

----------------解决方案--------------------------------------------------------
以后出了问题要先仔细检查下代码.
----------------解决方案--------------------------------------------------------

多谢各位开导,我会仔细的,昨晚弄一晚上,也不知哪个劲搭错了,就是没弄明白,有时候就一叶障目了


----------------解决方案--------------------------------------------------------
  相关解决方案