SwingEngine.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:msInspect 作者:
/**
 * Displays the GUI during a RAD session. If the root component is neither a JFrame nor a JDialog, the a JFrame is
 * instantiated and the root is added into the new frames contentpane.
 */
public void test() {
  WindowListener wl = new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
      super.windowClosing(e);
      System.exit(0);
    }
  };
  if (root != null) {
    if (JFrame.class.isAssignableFrom(root.getClass())
            || JDialog.class.isAssignableFrom(root.getClass())) {
      ((Window) root).addWindowListener(wl);
      root.setVisible(true);
    } else {
      JFrame jf = new JFrame("SwiXml Test");
      jf.getContentPane().add(root);
      jf.pack();
      jf.addWindowListener(wl);
      jf.setVisible(true);
    }
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号