//SwingPractice.java import java.awt.*; import javax.swing.*; import java.awt.event.*; public class SwingPractice extends JFrame implements ActionListener{ // allows me to practice designing with the Swing components //JLabel lblThing = new JLabel(new ImageIcon("guitar.gif")); JLabel lblThing = new JLabel("hey there..."); JButton btnColor = new JButton("Choose a color"); public static void main(String args[]){ SwingPractice sp = new SwingPractice(); sp.setSize(200,200); sp.show(); } // end main public SwingPractice(){ super("Whee, I'm in Swing!!"); Container pane = getContentPane(); pane.add(lblThing, BorderLayout.CENTER); pane.add(btnColor, BorderLayout.SOUTH); btnColor.addActionListener(this); lblThing.setText("Whoo Hoo!"); } // end constructor public void actionPerformed(ActionEvent e){ Color myColor = JColorChooser.showDialog(this, "Choose a color", Color.red); lblThing.setForeground(myColor); btnColor.setForeground(myColor); repaint(); } // end actionperformed } // end SwingPractice