Java中的Swing及AWT又称GUI编程

Java中的Swing及AWT又称GUI编程。

关于学习Java要不要学Swing及AWT,这个完全取决于个人的开发及发展方向。

如果从事web方向的开发,则可以不用学习Swing及AWT。

如果从事的是GUI编程或C/S模式的编程,则要学习Swing及AWT。

 1 package Com.MySwing;
 2 import javax.swing.JFrame;
 3 import javax.swing.JLabel;
 4 public class FiveSwing {
 5     public static void main(String[] args) throws Exception {
 6         JFrame frame = new JFrame("swing test");
 7         frame.setSize(300, 200);
 8         frame.setLayout(null);
 9     
10          JLabel label = new JLabel("Hello World");
11          frame.setContentPane(label);
12         frame.setVisible(true);
13         
14     }
15 }

猜你喜欢

转载自www.cnblogs.com/borter/p/9375601.html