aboutsummaryrefslogtreecommitdiff
path: root/libjava/javax/swing/JRootPane.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/javax/swing/JRootPane.java')
-rw-r--r--libjava/javax/swing/JRootPane.java61
1 files changed, 57 insertions, 4 deletions
diff --git a/libjava/javax/swing/JRootPane.java b/libjava/javax/swing/JRootPane.java
index 4f067c9aab9..145750758a4 100644
--- a/libjava/javax/swing/JRootPane.java
+++ b/libjava/javax/swing/JRootPane.java
@@ -100,7 +100,7 @@ public class JRootPane extends JComponent
protected RootLayout()
{
}
-
+
/**
* DOCUMENT ME!
*
@@ -230,8 +230,8 @@ public class JRootPane extends JComponent
{
glassPane.setBounds(0, 0, containerSize.width,
containerSize.height);
- contentPane.setBounds(0, 0, containerSize.width,
- containerSize.height);
+ contentPane.setBounds(0, 0, containerSize.width,
+ containerSize.height);
}
layeredPane.setSize(containerSize.width, containerSize.height);
@@ -333,6 +333,11 @@ public class JRootPane extends JComponent
protected Container contentPane;
protected JButton defaultButton;
+
+ /**
+ * @since 1.4
+ */
+ private int windowDecorationStyle = NONE;
/**
* DOCUMENT ME!
@@ -341,8 +346,20 @@ public class JRootPane extends JComponent
*/
public void setJMenuBar(JMenuBar m)
{
+ JLayeredPane jlPane = getLayeredPane();
+ if (menuBar != null)
+ jlPane.remove(menuBar);
menuBar = m;
- getLayeredPane().add(menuBar, JLayeredPane.FRAME_CONTENT_LAYER);
+ if (menuBar != null)
+ jlPane.add(menuBar, JLayeredPane.FRAME_CONTENT_LAYER);
+ }
+
+ /**
+ * @deprecated Replaced by <code>setJMenuBar()</code>
+ */
+ public void setMenuBar(JMenuBar m)
+ {
+ setJMenuBar(m);
}
/**
@@ -356,6 +373,14 @@ public class JRootPane extends JComponent
}
/**
+ * @deprecated Replaced by <code>getJMenuBar()</code>
+ */
+ public JMenuBar getMenuBar()
+ {
+ return getJMenuBar();
+ }
+
+ /**
* DOCUMENT ME!
*
* @return DOCUMENT ME!
@@ -569,4 +594,32 @@ public class JRootPane extends JComponent
defaultButton = newButton;
firePropertyChange("defaultButton", oldButton, newButton);
}
+
+ /**
+ * @since 1.4
+ */
+ public int getWindowDecorationStyle()
+ {
+ return windowDecorationStyle;
+ }
+
+ /**
+ * @since 1.4
+ */
+ public void setWindowDecorationStyle(int style)
+ {
+ if (style != NONE
+ && style != FRAME
+ && style != INFORMATION_DIALOG
+ && style != ERROR_DIALOG
+ && style != COLOR_CHOOSER_DIALOG
+ && style != FILE_CHOOSER_DIALOG
+ && style != QUESTION_DIALOG
+ && style != WARNING_DIALOG)
+ throw new IllegalArgumentException("invalid style");
+
+ int oldStyle = windowDecorationStyle;
+ windowDecorationStyle = style;
+ firePropertyChange("windowDecorationStyle", oldStyle, style);
+ }
}