JSplitPane
seems to add a border to any Component
added to it.
This is most visible with nested JSplitPanes - e.g.:
public class JSplitPaneToy {
public static void main(String[] args) {
JSplitPane sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
makePanel(), makePanel());
sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, makePanel(), sp);
sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, makePanel(), sp);
sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, makePanel(), sp);
JFrame frame = new JFrame("JSplitPane Toy");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setContentPane(sp);
frame.pack();
frame.setVisible(true);
}
private static JScrollPane makePanel() {
JScrollPane pane = new JScrollPane(new JTable(
new Object[][]{{0, 1, 2}, {1, 2, 3}, {2, 3, 4}}, new Object[]{1, 2, 3}));
pane.setPreferredSize(new Dimension(200, 100));
return pane;
}
}
i.e. each subsequent nested component appears to be set further back - i.e. there is some form of shadow border being added.
- Why is this border being added? (Is this actually a border being added...?)
- How can I prevent this 'border' from being added?