本文整理汇总了Java中javax.swing.JRootPane.setBorder方法的典型用法代码示例。如果您正苦于以下问题:Java JRootPane.setBorder方法的具体用法?Java JRootPane.setBorder怎么用?Java JRootPane.setBorder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JRootPane
的用法示例。
在下文中一共展示了JRootPane.setBorder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: installBorder
import javax.swing.JRootPane; //导入方法依赖的package包/类
/**
* <p>给根窗格安装边框</p>
*
* <p>To install JRootPane border</p>
*
* @param root <code>JRootPane</code>
*/
protected void installBorder(JRootPane root)
{
int style = root.getWindowDecorationStyle();
// 这句必须,否则会出现无法安装边框的情况
// Sentence must, otherwise there will not be installed border situation
root.setBorder(null);
//
if(LuckPlatformUtils.isWindows())
{
root.setBorder(UIManager.getBorder(borderKeys[style]));
}
else
{
root.setBorder(LineBorder.createBlackLineBorder());
}
}
示例2: windowStateChanged
import javax.swing.JRootPane; //导入方法依赖的package包/类
public void windowStateChanged(WindowEvent e)
{
Window window = (Window) e.getSource();
if (window instanceof JFrame)
{
JFrame frame = (JFrame) window;
JRootPane rootPane = frame.getRootPane();
if(rootPane.getUI() instanceof LuckRootPaneUI)
{
LuckRootPaneUI rootPaneUI = (LuckRootPaneUI) rootPane.getUI();
rootPaneUI.getTitlePane().setState(e.getNewState());
}
if (e.getNewState() == JFrame.MAXIMIZED_BOTH)
{
rootPane.setBorder(null);
}
else if (e.getNewState() == JFrame.NORMAL)
{
rootPane.setBorder(UIManager.getBorder(LuckRootPaneUIBundle.FRAME_BORDER));
}
}
}
示例3: uninstallWindowDecorations
import javax.swing.JRootPane; //导入方法依赖的package包/类
/**
* Uninstalls the window decorations from the root pane. This should rarely
* be necessary, but we do it anyway.
*
* @param rp the root pane
*/
private void uninstallWindowDecorations(JRootPane rp)
{
rp.setBorder(null);
JLayeredPane lp = rp.getLayeredPane();
for (int i = lp.getComponentCount() - 1; i >= 0; --i)
{
if (lp.getComponent(i) instanceof MetalTitlePane)
{
lp.remove(i);
break;
}
}
}
示例4: uninstallBorder
import javax.swing.JRootPane; //导入方法依赖的package包/类
/**
* <p>去除窗格边框</p>
*
* <p>remove JRootPane border.</p>
*
* @param root
*/
protected void uninstallBorder(JRootPane root)
{
LookAndFeel.uninstallBorder(root);
root.setBorder(null);
}