本文整理匯總了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);
}