view rep/SessionManagerGUI.java @ 4:c0db426126b6

*** empty log message ***
author pin
date Tue, 11 Sep 2007 18:05:29 +0900
parents 02fa9a68d9a2
children 91a33a634fef
line wrap: on
line source

package rep;

import java.awt.BorderLayout;
import java.awt.Container;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class SessionManagerGUI implements Runnable{
	public static void main(String[] args) {
		SessionManagerGUI gui = new SessionManagerGUI();
		Thread th = new Thread( gui ); 
		th.start();
	}

	private RPanel rp;
	private JFrame frame;

	public void run() {
		frame = new JFrame("SessionManager");
		frame.setBounds(100, 100, 400, 300);
		rp =  new RPanel();
		Container cont = frame.getContentPane();
		cont.add(rp);

		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		//frame.pack();
		frame.setVisible(true);
	}

	public void addConnectionListener(ConnectionListener listener) {
		//System.out.println(rp.toString());
		while(rp == null){
			System.out.println("waiting for launching GUI.");
			try {
				Thread.sleep(50);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		rp.addConnectionListener(listener);
	}
}