其实用AWT做GUI的编程很简单,觉得这一部分不必学的太细,虽然函数很多,但是需要记住的却没有多少!只要知道这个流程就可以了.
一般一个GUI的窗口都是Frame.
// An example of GUI programming using AWT
class MyFrame extends Frame
{
public Myframe()
{ //deciding Layout method ,default is BoarderLayout,and others:GridLayout CardLayout FlowLayout
//add component here,like Button Panel Fieldtext
//class MyActionListener implements ActionListener
{ public void actionPerformed(ActionEvent e)
{......}
}
//here is other Listener method
//add MyactionListener to each component
}
public static void main(String [] args)
{ MyFrame myframe = new MyFrame();
....
}