//add a button.JButton b = new JButton(“Submit”);b. setBounds(50, 150, 100, 30);//add button to the frame.f. add(b);
How do I create a JButton?
- //add a button.
- JButton b = new JButton(“Submit”);
- b. setBounds(50, 150, 100, 30);
- //add button to the frame.
- f. add(b);
What is a JButton component?
Introduction. The class JButton is an implementation of a push button. This component has a label and generates an event when pressed. It can also have an Image.