Is this possible? I'd like to add a java file in each tab of this JFrame. I've already created the files, I'd just like to show both files in one. The files I'd like to add are commented out:
storageSP and calculatorEDL
import javax.swing.*;
import java.awt.event.*;
public class TabbedPane extends JFrame {
public TabbedPane() {
setTitle("Duck Calculators");
setSize(400,400);
JTabbedPane jtp = new JTabbedPane();
getContentPane().add(jtp);
JPanel jpStorageSP = new JPanel();//This will create the first tab
JPanel jpcalcEDL = new JPanel();//This will create the second tab
jtp.addTab("storageSP", jpStorageSP);
jtp.addTab("calculatorEDL", jpcalcEDL);
//jpStorageSP.add(storageSP.java);//add file
//jpcalcEDL.add(calculatorEDL.java);//add file
setVisible(true);
}
public static void main (String []args){
TabbedPane tab = new TabbedPane();
}
}