Advertisement
stoneman

Prozor

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