Java Swing GUI Question: Open new panel with button clicked.

Posted by bat on Stack Overflow See other posts from Stack Overflow or by bat
Published on 2010-06-05T08:23:07Z Indexed on 2010/06/05 8:32 UTC
Read the original article Hit count: 674

Filed under:
|
|

Java Swing GUI:

I am using ActionListener to preform the action when a button is clicked. What i want to do is when a button is clicked, open a new panel, but load/get the new panel from a different file.

This is what i have so far but i rather just link to another file. THANKS! =]

            public void actionPerformed(java.awt.event.ActionEvent e) {
                //LINK TO NEW FILE INSEAD OF...
                JFrame frame2 = new JFrame("Clicked");
                frame2.setVisible(true);
                frame2.setSize(200,200);
            }

© Stack Overflow or respective owner

Related posts about java

Related posts about gui