My JTabbedPane is in a JSplitPane in a JPanel, like this, but I don't want it to be small like that:
I want it to look like this:
How do I do that?
Here is my code:
Tabbed_Tables.java
public void setupWidow(){
JPanel left = new JPanel();
JPanel right = new JPanel();
JTabbedPane EntryTabs = new JTabbedPane();
JTabbedPane ViewTabs = new JTabbedPane();
EntryTabs.addTab("Form Entry", new FormEntry());
EntryTabs.setOpaque(true);
EntryTabs.addTab("Table Entry", new TableEntry());
//EntryTabs.setSize(new Dimension(500,500));
//ViewTabs.setSize(new Dimension(200,200));
ViewTabs.add("Help Window", new HelpWindow());
left.add(EntryTabs);
right.add(ViewTabs);
JSplitPane splitPane= new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,left, right);
splitPane.setSize(new Dimension(pane.getWidth(),pane.getHeight()));
//((JFrame) pane).setContentPane(splitPane);
pane.add(splitPane,BorderLayout.CENTER);
//this.setSize(500, 500);
this.setVisible(true);
this.revalidate();
}
Either add the
JTabbedPane
s directly to theJSplitPane
Or change the layout managers for
left
andright
toBorderLayout
See How to Use BorderLayout for more details