0
,這似乎不符合的WindowBuilder在上班的路上插件已在Config中設置了gui。當前一個命令運行時,它會創建一個空的小JFrame。配置的主要方法只包含以下內容:如何叫我習慣能夠通過運行</p> <pre><code>Config con = new Config(); con.setVisible(true); </code></pre> <p>但是創建另一個類的實例,它使用的WindowBuilder(Eclipse中)創建了一個類
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Config window = new Config();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
構造函數只是調用它包含內容創建一個初始化方法:
public Config(){
initialize();
}
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
frame.setLocationRelativeTo(null);
frame.setResizable(false);
//other configuration here
}
我如何可以調用配置從另一個類運行,可見?