1 package com.opensymphony.workflow.designer.swing; 2 3 import java.awt.Component ; 4 5 import javax.swing.*; 6 import javax.swing.border.Border ; 7 import javax.swing.plaf.BorderUIResource ; 8 import javax.swing.plaf.basic.BasicSplitPaneUI ; 9 10 public final class EmptyBorderSplitPane extends JSplitPane 11 { 12 private static final Border EMPTY_BORDER = BorderFactory.createEmptyBorder(); 13 14 public EmptyBorderSplitPane(int newOrientation, Component newLeftComponent, Component 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 ui = (BasicSplitPaneUI )getUI(); 30 ui.getDivider().setBorder(new BorderUIResource (EMPTY_BORDER)); 31 } 32 } | Popular Tags |