Can I put some tabs to the left and others to the right in a JTabbedPane? Or at least to add some tabs, then add an empty space, and then add other tabs?
Thanks!
Can I put some tabs to the left and others to the right in a JTabbedPane? Or at least to add some tabs, then add an empty space, and then add other tabs?
Thanks!
Use a CardLayout and just add your buttons.
Create a main panel that uses a BorderLayout. Add your CardLayout and cards to the SOUTH. Then create two button panels. One for the WEST and one for the EAST.
Or instead of creating two panels for the buttons you can use a BoxLayout and then add "glue" between the left and right buttons and the layout manager will add space automatically.
No, unfortunately, those behaviors are not supported by Swing (or SWT, for that matter).
(My interpretation of your question, since there seems to be some confusion, is that you were looking for behavior like this:
)
No, I don't think you can. You can try using two tabbed panes added onto a panel or splitpane. For example:
JPanel panel = new JPanel(new GridLayout(1,2));
JTabbedPane tabs = new JTabbedPane();
tabs.addTab("A", new JPanel());
tabs.addTab("B", new JPanel());
tabs.addTab("C", new JPanel());
panel.add(tabs);
JTabbedPane tabs2 = new JTabbedPane();
tabs2.addTab("X", new JPanel());
tabs2.addTab("Y", new JPanel());
tabs2.addTab("Z", new JPanel());
panel.add(tabs2);