Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- public class Test5 extends JFrame
- {
- public JButton reset;
- public Test5()
- {
- super("Simple Paint"); // title
- this.setLayout(null); // set no layout
- this.setSize(500, 500); // the size of the window
- this.setVisible(true); // the window is visible now
- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // exiting on close
- this.reset = new JButton("ButtonText"); // initializing the button
- reset.setBounds(185, 220, 100, 30); // setting its bounds(x, y, width, height)
- this.add(this.reset); // adding the button to the window
- }
- public static void main(String[] args)
- {
- new Test5();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement