import java.awt.*; import java.awt.event.*; import javax.swing.*; class GuiStart { public static void main (String[] arg) { try { UIManager.setLookAndFeel( UIManager.getCrossPlatformLookAndFeelClassName()); } catch (Exception e) { System.exit(1); } JFrame vindu = new JFrame("Exit"); vindu.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel panel = new JPanel(); vindu.add(panel); // Kode her: vindu.pack(); vindu.setLocationRelativeTo(null); vindu.setVisible(true); } }