Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package javaapplication23;
  7.  
  8. import java.awt.event.ActionEvent;
  9. import java.awt.event.ActionListener;
  10. import javax.swing.JButton;
  11. import javax.swing.JFrame;
  12. import javax.swing.JLabel;
  13.  
  14. /**
  15. *
  16. * @author diogo
  17. */
  18. public class Janela {
  19.  
  20. /**
  21. * @param args the command line arguments
  22. */
  23. JFrame frm1 ,frm2 , frm3 ;
  24. JLabel lbl1 , lbl2 ;
  25. JButton btn ;
  26. ActionListener updateListener ;
  27.  
  28. public Janela () {
  29. frm1 = new JFrame (" Janela 1");
  30. lbl1 = new JLabel (" 0");
  31. frm1 . add ( lbl1 );
  32. frm1 . setSize (200 , 200);
  33. frm1 . setLocation (200 , 100);
  34. frm1 . setVisible ( true );
  35.  
  36. frm2 = new JFrame (" Janela 2");
  37. lbl2 = new JLabel (" 0");
  38. frm2 . add ( lbl2 );
  39. frm2 . setSize (200 , 200);
  40. frm2 . setLocation (800 , 100);
  41. frm2 . setVisible ( true );
  42.  
  43. frm3 = new JFrame (" Janela 3");
  44. btn = new JButton (" Parar / Continuar ");
  45. updateListener = new ActionListener (){
  46. @Override
  47. public void actionPerformed ( ActionEvent e) {
  48. // INSERT BUTTON CODE HERE
  49. }
  50.  
  51. };
  52. btn . addActionListener ( updateListener );
  53. frm3 . add (btn );
  54. frm3 . setSize (200 , 200);
  55. frm3 . setLocation (500 , 200);
  56. frm3 . setVisible ( true );
  57. }
  58.  
  59.  
  60.  
  61.  
  62. public static void main ( String args []) {
  63. Janela main = new Janela ();
  64.  
  65.  
  66. }
  67.  
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement