Advertisement
Guest User

asddsa

a guest
Oct 29th, 2012
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.95 KB | None | 0 0
  1. package javaapplication5;
  2. public class JavaApplication5 {
  3. public static void main(String[] args) {
  4.   new Frame();
  5.   new Button();
  6.  }
  7. }
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14. package javaapplication5;
  15. import javax.swing.*;
  16. public class Frame  {
  17.  public Frame(){
  18.  CreatFrame();      
  19.  }
  20.   JFrame Frame = new JFrame();
  21.  public JFrame CreatFrame(){
  22.  Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  23.  Frame.setVisible(true);
  24.  Frame.setSize(500,500);
  25.  Frame.setResizable(false);
  26.  Frame.setLayout(null);
  27.  return Frame;
  28. }
  29. public void addButton(JButton laws ){
  30. Frame.add(laws);
  31.  }
  32. }
  33.  
  34.  
  35.  
  36.  
  37. package javaapplication5;
  38. import javax.swing.JButton;
  39. public class Button {
  40.    public Button() {
  41.      Frame AddButton = new Frame();
  42.      AddButton.addButton(creatButton());
  43.     }
  44.    
  45.    public JButton creatButton(){
  46.      JButton asd = new JButton("Button");
  47.      asd.setVisible(true);
  48.      asd.setSize(100,70);
  49.      asd.setLocation(175, 175);
  50.        return asd;
  51.    }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement