本文整理汇总了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;
}