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();
    }
}

I'd just like to show both files in one. The files I'd like to add are commented out:

Why are they commented out?
What does the API doc for the addTab method say are valid arguments for it?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.