package com.kuro;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
public class MyFrame extends JFrame {
public MyFrame() {
// TODO Auto-generated constructor stub
JButton button = new JButton("Hello");
JPanel panel = new JPanel();
panel.add(button);
add(panel);
try {
UIManager
.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
SwingUtilities.updateComponentTreeUI(this);
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnsupportedLookAndFeelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
setSize(600, 400);
setVisible(true);
}
public static void main(String[] args) {
MyFrame mf = new MyFrame();
}
}
'Programming > JAVA,JSP' 카테고리의 다른 글
JAVA TCP 통신 예제 (0) | 2012.11.17 |
---|---|
Java 계산기 레이아웃 (0) | 2012.11.17 |
JAVA Look and Feel 활용 사이트 (0) | 2012.11.04 |
JAVA Applet Chatting Client (0) | 2012.07.26 |
Java 채팅 코드 (0) | 2012.07.25 |