JFrame, - . , createAndShowGUI():
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
createAndShowGUI();
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
}
});
}
JFrame:
static void createAndShowGUI() throws UnsupportedLookAndFeelException {
frame = new JFrame("Name of the window");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
new Interface();
frame.pack();
frame.setSize(700, 400);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
() , JPanels , .
, , ? , Swing.