stoneman

Prozor.java

May 29th, 2012
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.34 KB | None | 0 0
  1. package grafika;
  2.  
  3. import java.awt.BorderLayout;
  4. import java.awt.Dimension;
  5. import java.awt.LayoutManager;
  6. import java.awt.Toolkit;
  7.  
  8. import javax.swing.JButton;
  9. import javax.swing.JFrame;
  10. import javax.swing.JLabel;
  11. import javax.swing.JPanel;
  12. import javax.swing.JTextArea;
  13.  
  14. import dogadjaji.Oslus;
  15.  
  16. public class Prozor extends JFrame
  17. {
  18.     private Dimension screenSize;
  19.     private Dimension velicina;
  20.     private JPanel pano;
  21.     private JLabel info;
  22.     private JLabel infoDown;
  23.    
  24.     public JTextArea unos,izlaz;
  25.     public JButton submit;
  26.    
  27.     private Oslus oo;
  28.    
  29.     public Prozor()
  30.     {
  31.         screenSize = Toolkit.getDefaultToolkit().getScreenSize();
  32.         velicina = new Dimension(300,265);
  33.         setSize(velicina);
  34.         setResizable(false);
  35.         setTitle(".:: Slagalica by stoneman ::.");
  36.         setLocation((int)(screenSize.getWidth()/2-velicina.getWidth()/2), (int)(screenSize.getHeight()/2-velicina.getHeight()/2));
  37.    
  38.         pano = new JPanel();
  39.         oo = new Oslus(this);
  40.        
  41.         unos = new JTextArea(1,13);
  42.         info = new JLabel("Autor programa ne ohrabruje varanje!");
  43.         submit = new JButton("Pronadji");
  44.         izlaz = new JTextArea(10,13);
  45.         submit.addActionListener(oo);
  46.         infoDown = new JLabel(" --- deset najduzih reci --- ");
  47.        
  48.        
  49.         pano.add(info);
  50.         pano.add(unos);
  51.         pano.add(submit);
  52.         pano.add(infoDown);
  53.         pano.add(izlaz);
  54.        
  55.         this.add(pano);
  56.        
  57.        
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment