View Javadoc

1   /*
2    * Copyright 2005,2009 Ivan SZKIBA
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.ini4j.demo;
17  
18  import java.awt.Dimension;
19  
20  import javax.swing.JFrame;
21  import javax.swing.SwingUtilities;
22  import javax.swing.UIManager;
23  
24  public class DemoMain implements Runnable
25  {
26      private Demo _demo;
27  
28      public static void main(String[] args)
29      {
30          try
31          {
32              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
33          }
34          catch (Exception x)
35          {
36              x.printStackTrace();
37          }
38  
39          SwingUtilities.invokeLater(new DemoMain());
40      }
41  
42      @Override public void run()
43      {
44          JFrame frame = new JFrame("TopLevelDemo");
45  
46          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
47          frame.setPreferredSize(new Dimension(800, 600));
48          _demo = new Demo(frame.getContentPane());
49          _demo.init();
50          frame.pack();
51          frame.setVisible(true);
52      }
53  }