Hey eveyone. Im taking an intro to programming class in school and tried practicing at home. Only problem ive had is that my jbuttons dont work. Everytime i try to add text to them, it get an error compiling.. the error is
"cannot find symbol - constructor JButton(java.lang.String)"
heres my code.. thanks
Code:import java.awt.*; import javax.swing.*; import java.awt.event.*; public class JButton extends JApplet implements ActionListener { Container c; JButton button; public void init() { c = getContentPane(); c.setLayout(new FlowLayout()); button = new JButton("hey"); c.add(button); } public void actionPerformed(ActionEvent e) { } }


Reply With Quote


Bookmarks