01: package com.opensymphony.workflow.designer.swing;
02:
03: import java.awt.Component;
04:
05: import javax.swing.*;
06: import javax.swing.border.Border;
07: import javax.swing.plaf.BorderUIResource;
08: import javax.swing.plaf.basic.BasicSplitPaneUI;
09:
10: public final class EmptyBorderSplitPane extends JSplitPane {
11: private static final Border EMPTY_BORDER = BorderFactory
12: .createEmptyBorder();
13:
14: public EmptyBorderSplitPane(int newOrientation,
15: Component newLeftComponent, Component newRightComponent) {
16: super (newOrientation, newLeftComponent, newRightComponent);
17: setBorder(EMPTY_BORDER);
18: setOneTouchExpandable(true);
19: }
20:
21: public void updateUI() {
22: super .updateUI();
23: removeDividerBorder();
24: }
25:
26: private void removeDividerBorder() {
27: BasicSplitPaneUI ui = (BasicSplitPaneUI) getUI();
28: ui.getDivider().setBorder(new BorderUIResource(EMPTY_BORDER));
29: }
30: }
|