I have seen many posts on this topic but so far no resolution. What I want is for the two buttons on the divider to be visible but the rest of the divider be invisible. Since my page is white I thought I could set the divider background to white and the problem would be solved. However, no matter which way I use to set the divider background, the buttons disappear as well!
I have tried
UIManager.put("SplitPaneDivider.border", BorderFactory.createMatteBorder(5, 5, 5, 5, Color.red));
and I have tried extending the BasicSplitPaneUI class :
public class InvisibleDividerSplitPaneUI extends BasicSplitPaneUI {
public InvisibleDividerSplitPaneUI() {
super();
}
public BasicSplitPaneDivider createDefaultDivider() {
return new InvisibleDivider(this);
}
class InvisibleDivider extends BasicSplitPaneDivider {
public InvisibleDivider(BasicSplitPaneUI basicSplitPaneUI) {
super(basicSplitPaneUI);
setLayout(new BorderLayout());
JPanel jPanel = new JPanel();
//JButton leftButton = createLeftOneTouchButton();
//JButton rightButton = createRightOneTouchButton();
//jPanel.add(leftButton);
//jPanel.add(rightButton);
jPanel.setBackground(PILFColorThemes.formFieldBackgroundColor);
jPanel.setBorder(new LineBorder(PILFColorThemes.formFieldBackgroundColor));
add(jPanel);
setBorder(new LineBorder(PILFColorThemes.formFieldBackgroundColor));
}
public int getDividerSize() {
return 8;
}
}
}
In both cases the divider color is changed but the buttons are gone! Any one have an idea?!
Thanks so much!