//HelloJFrame //swing GUI HELLO WORLD import javax.swing.*; import java.awt.*; import java.awt.event.*; public class HelloJFrame extends JFrame implements ActionListener{ public static void main(String args[]){ HelloJFrame h = new HelloJFrame("My first program"); } // end main JButton btnClickMe = new JButton("Click Me"); JLabel lblOutput = new JLabel(""); public HelloJFrame(String title){ super(title); Component mainPanel = this.getContentPane(); this.setLayout(new GridLayout(0, 1)); this.add(lblOutput); this.add(btnClickMe); btnClickMe.addActionListener(this); this.show(); this.pack(); } // end constructor public void actionPerformed(ActionEvent e){ lblOutput.setText("Hi there"); } } // end class