substance look&feel 사용예

|

import javax.swing.*;
import java.awt.*;
import org.jvnet.substance.SubstanceLookAndFeel;    //substance look&feel사용
import org.jvnet.substance.theme.*;                       // theme사용


public class Walkthrough extends JFrame{

    public Walkthrough() {
       
      super("Sample app");

      final JComboBox combo1 = new JComboBox(new Object[] { "entry1",
                                                                 "entry2", "entry3", "entry4", "entry5", "entry6" });


      combo1.setToolTipText("This is my combo 1");     //툴팁 설정
      combo1.setMaximumRowCount(4);                     // 보여질 row갯수 설정
      combo1.setEditable(true);
 

      add(combo1);
      setLayout(new FlowLayout());
      add(new JButton("button"));
      add(new JCheckBox("check"));
      add(new JLabel("label"));
     
      this.pack();
      this.setSize(this.getPreferredSize());
      this.setLocationRelativeTo(null);


      this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    }// 생성자
 
   public static void main(String[] args) {
 

      try {

       // 사용할 테마 설정

       SubstanceLookAndFeel.setCurrentTheme(new SubstanceAquaTheme());


      //  look&fell설정
       UIManager.setLookAndFeel(new SubstanceLookAndFeel());
    

    } catch (UnsupportedLookAndFeelException ulafe) {
        System.out.println("Substance failed to set");
    }//catch


         //이분분이 윈도우 프레임 변경

     JFrame.setDefaultLookAndFeelDecorated(true);

 

        Walkthrough w = new Walkthrough();
        w.setVisible(true);
   }//main

 } //class



SubstanceAquaTheme

 
 
SubstanceBottleGreenTheme
 
 
SubstanceBrownTheme
 
 
 
SubstanceOrangeTheme
 
 
SubstanceBarbyPinkTheme

'JAVA/JSP > Source' 카테고리의 다른 글

그림판  (0) 2008.07.15
substance look&feel colorchart  (0) 2008.07.14
Garbage Collection 사용예  (0) 2008.07.14
정렬/ 중복배제  (0) 2008.07.14
간단한 서버/클라이언트  (0) 2008.07.14
And