下面列出了javax.swing.JRootPane#setLayout ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* <p>安装布局</p>
*
* <p>set JRootPane layout</p>
*
* @param root
*/
protected void installLayout(JRootPane root)
{
if (layoutManager == null)
{
layoutManager = createLayout();
}
savedOldLayout = root.getLayout();
root.setLayout(layoutManager);
}
protected void uninstallLayout(JRootPane root)
{
if (savedOldLayout != null)
{
root.setLayout(savedOldLayout);
savedOldLayout = null;
}
layoutManager = null;
}
/**
* Installs the appropriate LayoutManager on the <code>JRootPane</code>
* to render the window decorations.
*
* @param root the root
*/
private void installLayout(JRootPane root)
{
if (layoutManager == null)
{
layoutManager = createLayoutManager();
}
savedOldLayout = root.getLayout();
root.setLayout(layoutManager);
}
/**
* Uninstalls the previously installed <code>LayoutManager</code>.
*
* @param root the root
*/
private void uninstallLayout(JRootPane root)
{
if (savedOldLayout != null)
{
root.setLayout(savedOldLayout);
savedOldLayout = null;
}
}
/**
* Installs the appropriate LayoutManager on the <code>JRootPane</code> to
* render the window decorations.
*
* @param root the JRootPane.
*/
private void installLayout(JRootPane root) {
if (layoutManager == null) {
layoutManager = createLayoutManager();
}
savedOldLayout = root.getLayout();
root.setLayout(layoutManager);
}
/**
* Uninstalls the previously installed <code>LayoutManager</code>.
*
* @param root the JRootPane.
*/
private void uninstallLayout(JRootPane root) {
if (savedOldLayout != null) {
root.setLayout(savedOldLayout);
savedOldLayout = null;
}
}