コード例 #1
0
 void setLookAndFeel() {
   Properties p2 = new Properties();
   p2 = loadProperties(PROP_FILE);
   String skin = p2.getProperty("Skin");
   if (skin == null) {
     skin = "0";
   }
   int skinInt = Integer.valueOf(skin).intValue();
   try {
     if (skinInt == 0) {
       UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
     } else if (skinInt == 1) {
       UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
     } else {
       UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
     }
   } catch (Exception e) {
     System.out.println(e.toString());
   }
 }
コード例 #2
0
 /** Applet initialization */
 public void init() {
   // Get the port to be used
   String port_str = getParameter("port");
   if (port_str != null) {
     port = Integer.parseInt(port_str);
   }
   // Try to use the system look and feel
   try {
     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
   } catch (Exception e) {
   }
   // Create main panel to hold notebook
   main_panel = new JPanel();
   main_panel.setBackground(Color.white);
   main_panel.setLayout(new BorderLayout());
   setContentPane(main_panel);
   // Create the notebook
   tabbed_pane = new JTabbedPane(JTabbedPane.TOP);
   main_panel.add(tabbed_pane, BorderLayout.CENTER);
   // Add notebook page for default host connection
   pages = new Vector();
   addPage(new SOAPMonitorPage(getCodeBase().getHost()));
 }