/** @param args the command line arguments */
  public static void main(String args[]) {
    NativeInterface.open();
    UIUtils.setPreferredLookAndFeel();
    try {
      org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
      UIManager.put("RootPane.setupButtonVisible", false);
    } catch (Exception e) {
    }
    /* Set the Nimbus look and feel */
    // <editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
    /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
     * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
     */
    try {
      for (javax.swing.UIManager.LookAndFeelInfo info :
          javax.swing.UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
          javax.swing.UIManager.setLookAndFeel(info.getClassName());
          break;
        }
      }
    } catch (ClassNotFoundException ex) {
      java.util.logging.Logger.getLogger(WebBrowser.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
      java.util.logging.Logger.getLogger(WebBrowser.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
      java.util.logging.Logger.getLogger(WebBrowser.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    } catch (javax.swing.UnsupportedLookAndFeelException ex) {
      java.util.logging.Logger.getLogger(WebBrowser.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    }
    // </editor-fold>
    // </editor-fold>

    SwingUtilities.invokeLater(
        new Runnable() {
          public void run() {
            JFrame frame = new JFrame("Gourmet Solutions");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.getContentPane().add(createContent(), BorderLayout.CENTER);

            frame.setSize(800, 600);
            frame.setLocationByPlatform(false);
            //               frame.setLocationRelativeTo(null);

            frame.setVisible(true);
          }
        });
    NativeInterface.runEventPump();
  }
Esempio n. 2
0
 /** @param args */
 public static void main(String[] args) {
   // TODO Auto-generated method stub
   NativeInterface.open();
   SwingUtilities.invokeLater(
       new Runnable() {
         public void run() {
           thisClass = new GUI();
           thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           thisClass.setVisible(true);
         }
       });
   NativeInterface.runEventPump();
 }
 /* Standard main method to try that test as a standalone application. */
 public static void main(String[] args) {
   NativeInterface.open();
   UIUtils.setPreferredLookAndFeel();
   SwingUtilities.invokeLater(
       new Runnable() {
         public void run() {
           JFrame frame = new JFrame("DJ Native Swing Test");
           frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           frame.getContentPane().add(createContent(), BorderLayout.CENTER);
           frame.setSize(800, 600);
           frame.setLocationByPlatform(true);
           frame.setVisible(true);
         }
       });
   NativeInterface.runEventPump();
 }
Esempio n. 4
0
  public static void getJpg(final String url, final String path) {

    NativeInterface.open();
    SwingUtilities.invokeLater(
        new Runnable() {
          public void run() {
            // SWT组件转Swing组件,不初始化父窗体将无法启动webBrowser
            JFrame frame = new JFrame("以DJ组件保存指定网页截图");
            // 加载指定页面,最大保存为1024x768的截图
            // http://172.17.181.132:8080//ThunderChart3/chart/jsp/chart.jsp?file=bkyw0&para=u007Byear:'2012',org:'99'u007B
            frame
                .getContentPane()
                .add(new JpgServiceImpl(url, path, 2000, 20000), BorderLayout.CENTER);
            frame.setSize(2048, 10000);
            // 仅初始化,但不显示
            frame.invalidate();
            frame.pack();
            frame.setVisible(false);
          }
        });
    NativeInterface.runEventPump();
  }