For some reason the JTabbedPane isn't showing up. I tried changing its orientation to bottom and then left to see if that would fix it but it didn't.
It was just a simple program to see if all three could go together.
import java.awt.*; import java.awt.event.*; import javax.swing.JOptionPane; import javax.swing.*; import java.util.*; import java.io.*; public class TesterClassOne extends JFrame { private JToggleButton jtb; public TesterClassOne() { JMenuBar jmb = new JMenuBar(); setJMenuBar(jmb); JMenu aMenu = new JMenu("Menu"); jmb.add(aMenu); JMenuItem anItem = new JMenuItem("A JMenuItem"); aMenu.add(anItem); JTabbedPane jtp = new JTabbedPane(JTabbedPane.LEFT); jtp.addTab("A Tab", null); jtp.addTab("Another Tab", null); add(jtp); setVisible(true); jtp.setVisible(true); // setContentPane(getContentPane()); } public static void main(String[] args) { TesterClassOne tc1 = new TesterClassOne(); JToolBar jtba = new JToolBar(); tc1.add(jtba); JButton aButton = new JButton("A JButton"); jtba.add(aButton); JButton aButton2 = new JButton("Another JButton"); jtba.add(aButton2); } }
I have tried it with the setConentPane() and without it too. Doesn't appear to make a difference. Have tried it where all three were in constructor and also when all three were in main. (Defined there I mean.) Neither one solves the problem. I've tried some combinations and it still doesn't appear to work.