Java Swing GUI Question: Open new panel with button clicked.
- by bat
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);
}