import javax.swing.*; class Three extends JFrame { Three(String title, int width, int height) { JButton button = new JButton("Click me!"); JLabel label = new JLabel("Hello, World!"); JPanel panel = new JPanel(); panel.add(button); panel.add(label); this.add(panel); this.setSize(width, height); this.setTitle(title); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); } public static void main(String[] args) { Three f = new Three("Simple Frame", 300, 100); } }