KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > javax > swing > UIManager

javax.swing
Class UIManager

java.lang.Object
  extended by javax.swing.UIManager
All Implemented Interfaces:
Serializable
See Also:
Top Examples, Source Code, XMLEncoder, Properties

public static void addAuxiliaryLookAndFeel(LookAndFeel laf)
See Also:
getInstalledLookAndFeels(), getAuxiliaryLookAndFeels(), setLookAndFeel(javax.swing.LookAndFeel), removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1384]Change JFrame Look And Feel
By Anonymous on 2005/06/02 01:04:58  Rate
import javax.swing.*; 
 import java.awt.*; 
 import javax.swing.border.*; 
 import java.awt.event.*; 
 import java.net.*; 
 import java.io.*; 
 import java.sql.*; 
 import java.math.*; 
 import java.util.*; 
  
  
 public class Main extends JFrame  
  {                           
   //private JLabel              Label1,Label2,Label3,Label4,Label5,Label6; 
     //private TextField          Text1,Text2,Text3,Text4,Text5,Text6,Text7,Text8,Text9,Text10; 
     private JButton           Button1,Button2,Button3,Button4; 
   //private JComboBox      Combo1;   
     private Font          f1,f2; 
   private JPanel panel1; 
   private Main pf; 
   //private Statement st; 
   //private Connection con; 
    
   public  Main  (  )  throws Exception 
      {  
       java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit (  ) .getScreenSize (  ) ; 
         setSize ( 350,250 ) ; 
         setLocation (  ( screenSize.width-150 ) /2, ( screenSize.height-100 ) /2 ) ; 
         setTitle ( "Create New User Module" ) ; 
     
         panel1 = new JPanel (  ) ; 
         panel1.setLayout ( null ) ; 
                        
         //panel1.setBackground ( Color.cyan ) ; 
         f1 = new Font ( "TimesRoman",Font.BOLD+Font.ITALIC,25 ) ; 
         f2 = new Font ( "TimesRoman",Font.BOLD,17 ) ; 
         MainDesign (  ) ; 
        }  
     public static void main ( String  [  ]  args )  throws Exception 
         {  
          try 
        {  
               javax.swing.UIManager.setLookAndFeel ( new javax.swing.plaf.metal.MetalLookAndFeel (  )  ) ; 
              }  
             catch ( Exception e )  
              {  
               System.out.println ( e.getMessage (  )  ) ; 
              }  
             new Main (  ) .show (  ) ;       
      }          
         public  void MainDesign (  )  throws Exception 
          {  
      
       /*try 
        {  
         st=con.createStatement (  ) ;     
        }  
       catch ( Exception e )  
        {  
         System.out.println ( "3"+e ) ; 
        }                  
                  
                 /*Label1 = new JLabel ( "ADMIN" ) ; 
                  
                 //Label2 = new JLabel ( "USERS" ) ; 
                  
  
  
                 Text1 = new TextField (  ) ; 
                 Text2 = new TextField ( 20 ) ; 
                  
                      
                 Label1.setBounds ( 150,80,150,20 ) ; 
                 Text1.setBounds ( 320,80,150,20 ) ; 
  
  
                 Label2.setBounds ( 150,120,150,20 ) ; 
                 Text2.setBounds ( 320,120,80,20 ) ; 
                 */
 
                  
                 Button1= new JButton ( "ADMIN Module" ) ; 
                 Button2= new JButton ( "USERS Module" ) ; 
                 Button4= new JButton ( "CHATTING Module" ) ; 
                 Button3= new JButton ( "OutExit" ) ; 
                  
                 Button1.setBounds ( 100,20,200,30 ) ; 
                 Button2.setBounds ( 100,70,200,30 ) ; 
                 Button4.setBounds ( 100,120,200,30 ) ; 
              Button3.setBounds ( 100,170,200,30 ) ; 
  
  
               // Label1.setFont ( f2 ) ; 
 // Label2.setFont ( f2 ) ; 
  
  
                 Button1.setFont ( f2 ) ; 
                 Button2.setFont ( f2 ) ; 
         Button3.setFont ( f2 ) ; 
         Button4.setFont ( f2 ) ; 
  
  
                 /*panel1.add ( Label1 ) ; 
                 panel1.add ( Label2 ) ; 
                 panel1.add ( Text1 ) ; 
                 panel1.add ( Text2 ) ; 
 */
 
                 panel1.add ( Button1 ) ; 
                 panel1.add ( Button2 ) ; 
                 panel1.add ( Button3 ) ; 
                 panel1.add ( Button4 ) ; 
  
  
                 getContentPane (  ) .add ( panel1 ) ; 
  
  
                 panel1.setVisible ( true ) ; 
         pf = this; 
                 Button1.addActionListener ( new java.awt.event.ActionListener (  )  
                  {  
                         public void actionPerformed ( java.awt.event.ActionEvent evt )  
                          {  
                           try {  
                             dispose (  ) ; 
                             new PamFrame1 (  ) .show (  ) ;   
                            } catch ( Exception e )  {  } ;                       
                          }  
                  }  ) ; 
                 Button2.addActionListener ( new java.awt.event.ActionListener (  )  
                  {  
                         public void actionPerformed ( java.awt.event.ActionEvent evt )  
                          {  
               try {  
               dispose (  ) ; 
               new PamFrame (  ) .show (  ) ; 
                } catch ( Exception e )  {  } ; 
                           }  
                  }  ) ; 
  
  
                 Button4.addActionListener ( new java.awt.event.ActionListener (  )  
                  {  
                         public void actionPerformed ( java.awt.event.ActionEvent evt )  
                          {  
               try {  
               dispose (  ) ; 
               new Server ( "100" ) ; 
                } catch ( Exception e )  {  } ; 
                           }  
                  }  ) ; 
  
  
         Button3.addActionListener ( new java.awt.event.ActionListener (  )  
                  {  
                         public void actionPerformed ( java.awt.event.ActionEvent evt )  
                          {  
               System.exit ( 0 ) ; 
                           }  
                  }  ) ; 
  
  
          }  
  } 


public static void addPropertyChangeListener(PropertyChangeListener listener)
See Also:
PropertyChangeSupport
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Object get(Object key)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Object get(Object key,
                         Locale l)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static LookAndFeel[] getAuxiliaryLookAndFeels()
See Also:
getInstalledLookAndFeels(), setLookAndFeel(javax.swing.LookAndFeel), removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel), addAuxiliaryLookAndFeel(javax.swing.LookAndFeel)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static boolean getBoolean(Object key)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static boolean getBoolean(Object key,
                                 Locale l)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Border getBorder(Object key)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Border getBorder(Object key,
                               Locale l)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Color getColor(Object key)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Color getColor(Object key,
                             Locale l)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static String getCrossPlatformLookAndFeelClassName()
See Also:
getSystemLookAndFeelClassName(), setLookAndFeel(javax.swing.LookAndFeel)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static UIDefaults getDefaults()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Dimension getDimension(Object key)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Dimension getDimension(Object key,
                                     Locale l)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Font getFont(Object key)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Font getFont(Object key,
                           Locale l)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Icon getIcon(Object key)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Icon getIcon(Object key,
                           Locale l)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Insets getInsets(Object key)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Insets getInsets(Object key,
                               Locale l)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static UIManager.LookAndFeelInfo[] getInstalledLookAndFeels()
See Also:
setLookAndFeel(javax.swing.LookAndFeel)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static int getInt(Object key)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static int getInt(Object key,
                         Locale l)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static LookAndFeel getLookAndFeel()
See Also:
setLookAndFeel(javax.swing.LookAndFeel)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static UIDefaults getLookAndFeelDefaults()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static PropertyChangeListener[] getPropertyChangeListeners()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static String getString(Object key)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static String getString(Object key,
                               Locale l)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static String getSystemLookAndFeelClassName()
See Also:
getCrossPlatformLookAndFeelClassName(), setLookAndFeel(javax.swing.LookAndFeel)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static ComponentUI getUI(JComponent target)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static void installLookAndFeel(String name,
                                      String className)
See Also:
setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[])
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static void installLookAndFeel(UIManager.LookAndFeelInfo info)
See Also:
setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[])
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Object put(Object key,
                         Object value)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf)
See Also:
getInstalledLookAndFeels(), setLookAndFeel(javax.swing.LookAndFeel), getAuxiliaryLookAndFeels()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static void removePropertyChangeListener(PropertyChangeListener listener)
See Also:
PropertyChangeSupport
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)
                                     throws SecurityException
See Also:
getInstalledLookAndFeels()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static void setLookAndFeel(String className)
                           throws ClassNotFoundException,
                                  InstantiationException,
                                  IllegalAccessException,
                                  UnsupportedLookAndFeelException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static void setLookAndFeel(LookAndFeel newLookAndFeel)
                           throws UnsupportedLookAndFeelException
See Also:
getLookAndFeel()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public UIManager()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags