Alright guys... not sure what's goin on here, but obviously something is happening that I"m unaware of. You can ignore the ActionEvent method at the bottom... What I want to do is have the word "test" about the text field.
package FifthFrame; import javax.swing.*; import java.awt.*; import java.awt.event.*; class MyJFrame extends JFrame implements ActionListener{ // private instance variables JButton button; int buttonCount; JTextField inputLine; JLabel label; public static void main (String [] args) { MyJFrame mine = new MyJFrame(); mine.setVisible(true); } public MyJFrame () { setTitle ("This is a \"MyJFrame\" object (V5)"); setSize (300, 500); setDefaultCloseOperation( EXIT_ON_CLOSE ); // get the content pane and set properties Container contentPane = getContentPane(); contentPane.setBackground (Color.blue); contentPane.setLayout(null); // so that we can use absolute positioning // construct a button, and set the number of click on it to 0 button = new JButton("0"); button.setBounds(110,230,80,40); button.addActionListener(this); contentPane.add(button); buttonCount = 0; // construct a text field inputLine = new JTextField(); inputLine.setBounds(100,100,100,20); inputLine.addActionListener(this); contentPane.add(inputLine); label = new JLabel ("test", JLabel.CENTER); label.setForeground(Color.white); contentPane.add(label); } public void actionPerformed(ActionEvent event) { buttonCount++; button.setText(Integer.toString(buttonCount)); inputLine.setText(""); } }