How Do You Create a Jbutton

How Do You 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);

How do I create a JButton?

  1. //add a button.
  2. JButton b = new JButton(“Submit”);
  3. b. setBounds(50, 150, 100, 30);
  4. //add button to the frame.
  5. 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.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.