Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

asddsa

By: a guest on Oct 29th, 2012  |  syntax: Java  |  size: 0.95 KB  |  views: 116  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }