Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package javaapplication23;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.JButton;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- /**
- *
- * @author diogo
- */
- public class Janela {
- /**
- * @param args the command line arguments
- */
- JFrame frm1 ,frm2 , frm3 ;
- JLabel lbl1 , lbl2 ;
- JButton btn ;
- ActionListener updateListener ;
- public Janela () {
- frm1 = new JFrame (" Janela 1");
- lbl1 = new JLabel (" 0");
- frm1 . add ( lbl1 );
- frm1 . setSize (200 , 200);
- frm1 . setLocation (200 , 100);
- frm1 . setVisible ( true );
- frm2 = new JFrame (" Janela 2");
- lbl2 = new JLabel (" 0");
- frm2 . add ( lbl2 );
- frm2 . setSize (200 , 200);
- frm2 . setLocation (800 , 100);
- frm2 . setVisible ( true );
- frm3 = new JFrame (" Janela 3");
- btn = new JButton (" Parar / Continuar ");
- updateListener = new ActionListener (){
- @Override
- public void actionPerformed ( ActionEvent e) {
- // INSERT BUTTON CODE HERE
- }
- };
- btn . addActionListener ( updateListener );
- frm3 . add (btn );
- frm3 . setSize (200 , 200);
- frm3 . setLocation (500 , 200);
- frm3 . setVisible ( true );
- }
- public static void main ( String args []) {
- Janela main = new Janela ();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement