KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > designer > swing > EmptyBorderSplitPane


1 package com.opensymphony.workflow.designer.swing;
2
3 import java.awt.Component JavaDoc;
4
5 import javax.swing.*;
6 import javax.swing.border.Border JavaDoc;
7 import javax.swing.plaf.BorderUIResource JavaDoc;
8 import javax.swing.plaf.basic.BasicSplitPaneUI JavaDoc;
9
10 public final class EmptyBorderSplitPane extends JSplitPane
11 {
12   private static final Border JavaDoc EMPTY_BORDER = BorderFactory.createEmptyBorder();
13
14   public EmptyBorderSplitPane(int newOrientation, Component JavaDoc newLeftComponent, Component JavaDoc newRightComponent)
15   {
16     super(newOrientation, newLeftComponent, newRightComponent);
17     setBorder(EMPTY_BORDER);
18     setOneTouchExpandable(true);
19   }
20
21   public void updateUI()
22   {
23     super.updateUI();
24     removeDividerBorder();
25   }
26
27   private void removeDividerBorder()
28   {
29     BasicSplitPaneUI JavaDoc ui = (BasicSplitPaneUI JavaDoc)getUI();
30     ui.getDivider().setBorder(new BorderUIResource JavaDoc(EMPTY_BORDER));
31   }
32 }
Popular Tags