package realtimetrains; import java.awt.TextArea; import java.awt.event.ActionListener; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import javax.swing.JFrame; import javax.swing.JPanel; public class DebugWindow extends JFrame implements WindowListener { TextArea debug; public DebugWindow() { super("CS380 RealTime Trains Debug Window"); this.setSize(800, 600); this.setLocation(780, 80); debug = new TextArea(); this.add(debug); debug.setSize(320, 220); //debug.setLocation(320, 255); debug.setEditable(false); this.setVisible(true); } public synchronized void Append(String temp) { debug.append(temp + "\n"); } public void windowActivated(WindowEvent we) { } public void windowClosed(WindowEvent we) { } public void windowClosing(WindowEvent we) { if (we.getSource() == this) { this.setVisible(false); } } public void windowDeactivated(WindowEvent we) { } public void windowDeiconified(WindowEvent we) { } public void windowIconified(WindowEvent we) { } public void windowOpened(WindowEvent we) { } }