Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. import javax.swing.*;
  2.  
  3. public class Test5 extends JFrame
  4. {
  5.     public JButton reset;
  6.    
  7.     public Test5()
  8.     {
  9.         super("Simple Paint"); // title
  10.        
  11.         this.setLayout(null); // set no layout
  12.         this.setSize(500, 500); // the size of the window
  13.         this.setVisible(true); // the window is visible now
  14.         this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // exiting on close
  15.        
  16.         this.reset = new JButton("ButtonText"); // initializing the button
  17.         reset.setBounds(185, 220, 100, 30); // setting its bounds(x, y, width, height)
  18.         this.add(this.reset); // adding the button to the window
  19.     }
  20.  
  21.     public static void main(String[] args)
  22.         {
  23.             new Test5();
  24.         }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement