//PROGRAM 13-3 import java.awt.*; import java.awt.event.*; import javax.swing.*; class DemoFrame { private JLabel label; public DemoFrame() { label = new JLabel("Hallo Dunia..."); } public void createAndShowGUI() { JFrame.setDefaultLookAndFeelDecorated(true); JFrame frame = new JFrame("Demo Frame"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(label, BorderLayout.CENTER); //frame.pack(); frame.setBounds(0, 0, 300, 200); //ukuran frame frame.setLocationRelativeTo(null); //frame di tengah layar frame.setVisible(true); } public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { DemoFrame app = new DemoFrame(); app.createAndShowGUI(); } }); } }