本文整理匯總了Java中javax.swing.JSplitPane.getUI方法的典型用法代碼示例。如果您正苦於以下問題:Java JSplitPane.getUI方法的具體用法?Java JSplitPane.getUI怎麽用?Java JSplitPane.getUI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JSplitPane
的用法示例。
在下文中一共展示了JSplitPane.getUI方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: splitpane
import javax.swing.JSplitPane; //導入方法依賴的package包/類
/**
* Constructs a new SplitPane containing the two components given as
* arguments
*
* @param orientation - the orientation (HORIZONTAL_SPLIT or VERTICAL_SPLIT)
* @param first - the left component (if horizontal) or top component (if
* vertical)
* @param second - the right component (if horizontal) or bottom component
* (if vertical)
* @param initialDividerLocation - the initial divider location (in pixels)
*/
public static JSplitPane splitpane(int orientation, Component first, Component second, int initialDividerLocation) {
JSplitPane x = make(new JSplitPane(orientation, first, second), new EmptyBorder(0, 0, 0, 0));
x.setContinuousLayout(true);
x.setDividerLocation(initialDividerLocation);
x.setOneTouchExpandable(false);
x.setResizeWeight(0.5);
if (Util.onMac() && (x.getUI() instanceof BasicSplitPaneUI)) {
boolean h = (orientation != JSplitPane.HORIZONTAL_SPLIT);
((BasicSplitPaneUI) (x.getUI())).getDivider().setBorder(new OurBorder(h, h, h, h)); // Makes
// the
// border
// look
// nicer
// on
// Mac
// OS
// X
}
return x;
}
示例2: removeBordersFromSplitPane
import javax.swing.JSplitPane; //導入方法依賴的package包/類
public static void removeBordersFromSplitPane(JSplitPane split)
{
// remove the border from the split pane
split.setBorder(null);
// check the UI. If we can't work with the UI any further, then
// exit here.
if( !(split.getUI() instanceof BasicSplitPaneUI) )
{
return;
}
// grab the divider from the UI and remove the border from it
final BasicSplitPaneDivider divider = ((BasicSplitPaneUI) split.getUI()).getDivider();
if( divider != null )
{
// Taken from http://forums.sun.com/thread.jspa?threadID=566152
divider.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0),
new SplitPaneBorder(UIManager.getColor("SplitPane.background")))); //$NON-NLS-1$
}
}
示例3: tweakSplitPaneUI
import javax.swing.JSplitPane; //導入方法依賴的package包/類
private void tweakSplitPaneUI(JSplitPane splitPane) {
splitPane.setOpaque(false);
splitPane.setBorder(null);
splitPane.setDividerSize(3);
if (!(splitPane.getUI() instanceof BasicSplitPaneUI)) {
return;
}
BasicSplitPaneDivider divider = ((BasicSplitPaneUI) splitPane.getUI()).getDivider();
if (divider != null) {
divider.setBorder(null);
}
}
示例4: tweakSplitPaneUI
import javax.swing.JSplitPane; //導入方法依賴的package包/類
private static void tweakSplitPaneUI(JSplitPane splitPane) {
splitPane.setOpaque(false);
splitPane.setBorder(null);
splitPane.setDividerSize(3);
if (!(splitPane.getUI() instanceof BasicSplitPaneUI)) {
return;
}
BasicSplitPaneDivider divider = ((BasicSplitPaneUI) splitPane.getUI()).getDivider();
if (divider != null) {
divider.setBorder(null);
}
}
示例5: createInstanceImpl
import javax.swing.JSplitPane; //導入方法依賴的package包/類
protected BasicSplitPaneDivider createInstanceImpl() {
final JSplitPane split = new JSplitPane(orientation);
BasicSplitPaneUI ui = split.getUI() instanceof BasicSplitPaneUI ?
(BasicSplitPaneUI)split.getUI() : new BasicSplitPaneUI() {
{ installUI(split); }
};
return new BasicSplitPaneDivider(ui);
}
示例6: splitpane
import javax.swing.JSplitPane; //導入方法依賴的package包/類
/** Constructs a new SplitPane containing the two components given as arguments
* @param orientation - the orientation (HORIZONTAL_SPLIT or VERTICAL_SPLIT)
* @param first - the left component (if horizontal) or top component (if vertical)
* @param second - the right component (if horizontal) or bottom component (if vertical)
* @param initialDividerLocation - the initial divider location (in pixels)
*/
public static JSplitPane splitpane (int orientation, Component first, Component second, int initialDividerLocation) {
JSplitPane x = make(new JSplitPane(orientation, first, second), new EmptyBorder(0,0,0,0));
x.setContinuousLayout(true);
x.setDividerLocation(initialDividerLocation);
x.setOneTouchExpandable(false);
x.setResizeWeight(0.5);
if (Util.onMac() && (x.getUI() instanceof BasicSplitPaneUI)) {
boolean h = (orientation != JSplitPane.HORIZONTAL_SPLIT);
((BasicSplitPaneUI)(x.getUI())).getDivider().setBorder(new OurBorder(h,h,h,h)); // Makes the border look nicer on Mac OS X
}
return x;
}