Hi everyone. Just getting into Java and I have a question. I have 2 Java programs, MenuFrame.java and BoxFrame.java. My MenuFrame.java has two buttons in it, an "Exit" and "Open" button. My BoxFrame.java just prints out a line of text. My question is, how would I code the "Open" button so it creates an instance of the BoxFrame.java program in a new window? my actionPerformed for my "Exit" button currently looks like this;
I think the first thing is to start thinking in Java/object oriented terms. Rather than having 2 programs you have 2 Java classes. You can create objects from these classes at runtime, so you can create an instance of BoxFrame within Menuframe when the Open button is clicked...
hope this helps you along a little [ March 02, 2004: Message edited by: Ben Wood ] [ March 02, 2004: Message edited by: Ben Wood ]
SCJP 1.4, www.gsi3d.org.uk
Joined: Mar 02, 2004
Thank you Ben! That worked perfectly. I appreciate your help. I'm sure I'll be back with more questions as I progress.