Search

'setLookAndFeel'에 해당되는 글 1건

  1. 2012.11.04 setLookAndFeel 예제

setLookAndFeel 예제

Programming/JAVA,JSP 2012. 11. 4. 13:54 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

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