jdk/src/share/classes/javax/swing/JFrame.java

Print this page

        

@@ -34,16 +34,18 @@
 import java.awt.HeadlessException;
 import java.awt.Image;
 import java.awt.LayoutManager;
 import java.awt.event.WindowEvent;
 
+import java.beans.JavaBean;
+import java.beans.BeanProperty;
+
 import javax.accessibility.Accessible;
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleState;
 import javax.accessibility.AccessibleStateSet;
 
-
 /**
  * An extended version of <code>java.awt.Frame</code> that adds support for
  * the JFC/Swing component architecture.
  * You can find task-oriented documentation about using <code>JFrame</code>
  * in <em>The Java Tutorial</em>, in the section

@@ -109,20 +111,17 @@
  * @see JRootPane
  * @see #setDefaultCloseOperation
  * @see java.awt.event.WindowListener#windowClosing
  * @see javax.swing.RootPaneContainer
  *
- * @beaninfo
- *      attribute: isContainer true
- *      attribute: containerDelegate getContentPane
- *    description: A toplevel window which can be minimized to an icon.
- *
  * @author Jeff Dinkins
  * @author Georges Saab
  * @author David Kloba
  * @since 1.2
  */
+@JavaBean(defaultProperty = "JMenuBar", description = "A toplevel window which can be minimized to an icon.")
+@SwingContainer(delegate = "getContentPane")
 @SuppressWarnings("serial") // Same-version serialization only
 public class JFrame  extends Frame implements WindowConstants,
                                               Accessible,
                                               RootPaneContainer,
                               TransferHandler.HasGetTransferHandler

@@ -376,20 +375,17 @@
      * @throws  SecurityException
      *        if <code>EXIT_ON_CLOSE</code> has been specified and the
      *        <code>SecurityManager</code> will
      *        not allow the caller to invoke <code>System.exit</code>
      * @see        java.lang.Runtime#exit(int)
-     *
-     * @beaninfo
-     *   preferred: true
-     *       bound: true
-     *        enum: DO_NOTHING_ON_CLOSE WindowConstants.DO_NOTHING_ON_CLOSE
-     *              HIDE_ON_CLOSE       WindowConstants.HIDE_ON_CLOSE
-     *              DISPOSE_ON_CLOSE    WindowConstants.DISPOSE_ON_CLOSE
-     *              EXIT_ON_CLOSE       WindowConstants.EXIT_ON_CLOSE
-     * description: The frame's default close operation.
      */
+    @BeanProperty(preferred = true, enumerationValues = {
+            "WindowConstants.DO_NOTHING_ON_CLOSE",
+            "WindowConstants.HIDE_ON_CLOSE",
+            "WindowConstants.DISPOSE_ON_CLOSE",
+            "WindowConstants.EXIT_ON_CLOSE"}, description
+            = "The frame's default close operation.")
     public void setDefaultCloseOperation(int operation) {
         if (operation != DO_NOTHING_ON_CLOSE &&
             operation != HIDE_ON_CLOSE &&
             operation != DISPOSE_ON_CLOSE &&
             operation != EXIT_ON_CLOSE) {

@@ -446,16 +442,13 @@
      *
      * @see TransferHandler
      * @see #getTransferHandler
      * @see java.awt.Component#setDropTarget
      * @since 1.6
-     *
-     * @beaninfo
-     *        bound: true
-     *       hidden: true
-     *  description: Mechanism for transfer of data into the component
      */
+    @BeanProperty(hidden = true, description
+            = "Mechanism for transfer of data into the component")
     public void setTransferHandler(TransferHandler newHandler) {
         TransferHandler oldHandler = transferHandler;
         transferHandler = newHandler;
         SwingUtilities.installSwingDropTargetAsNecessary(this, transferHandler);
         firePropertyChange("transferHandler", oldHandler, newHandler);

@@ -487,15 +480,13 @@
    /**
     * Sets the menubar for this frame.
     * @param menubar the menubar being placed in the frame
     *
     * @see #getJMenuBar
-    *
-    * @beaninfo
-    *      hidden: true
-    * description: The menubar for accessing pulldown menus from this frame.
     */
+   @BeanProperty(bound = false, hidden = true, description
+           = "The menubar for accessing pulldown menus from this frame.")
     public void setJMenuBar(JMenuBar menubar) {
         getRootPane().setMenuBar(menubar);
     }
 
    /**

@@ -535,14 +526,13 @@
      *
      * @see #addImpl
      * @see #setLayout
      * @see #isRootPaneCheckingEnabled
      * @see javax.swing.RootPaneContainer
-     * @beaninfo
-     *      hidden: true
-     * description: Whether the add and setLayout methods are forwarded
      */
+    @BeanProperty(hidden = true, description
+            = "Whether the add and setLayout methods are forwarded")
     protected void setRootPaneCheckingEnabled(boolean enabled) {
         rootPaneCheckingEnabled = enabled;
     }
 
 

@@ -622,10 +612,12 @@
      * @return the <code>rootPane</code> property
      *
      * @see #setRootPane
      * @see RootPaneContainer#getRootPane
      */
+    @BeanProperty(bound = false, hidden = true, description
+            = "the RootPane object for this frame.")
     public JRootPane getRootPane() {
         return rootPane;
     }
 
 

@@ -633,14 +625,10 @@
      * Sets the <code>rootPane</code> property.
      * This method is called by the constructor.
      * @param root the <code>rootPane</code> object for this frame
      *
      * @see #getRootPane
-     *
-     * @beaninfo
-     *   hidden: true
-     * description: the RootPane object for this frame.
      */
     protected void setRootPane(JRootPane root)
     {
         if(rootPane != null) {
             remove(rootPane);

@@ -690,16 +678,13 @@
      * @exception java.awt.IllegalComponentStateException (a runtime
      *            exception) if the content pane parameter is <code>null</code>
      * @see #getContentPane
      * @see RootPaneContainer#setContentPane
      * @see JRootPane
-     *
-     * @beaninfo
-     *     hidden: true
-     *     description: The client area of the frame where child
-     *                  components are normally inserted.
      */
+    @BeanProperty(bound = false, hidden = true, description
+            = "The client area of the frame where child components are normally inserted.")
     public void setContentPane(Container contentPane) {
         getRootPane().setContentPane(contentPane);
     }
 
     /**

@@ -720,15 +705,13 @@
      *
      * @exception java.awt.IllegalComponentStateException (a runtime
      *            exception) if the layered pane parameter is <code>null</code>
      * @see #getLayeredPane
      * @see RootPaneContainer#setLayeredPane
-     *
-     * @beaninfo
-     *     hidden: true
-     *     description: The pane that holds the various frame layers.
      */
+    @BeanProperty(bound = false, hidden = true, description
+            = "The pane that holds the various frame layers.")
     public void setLayeredPane(JLayeredPane layeredPane) {
         getRootPane().setLayeredPane(layeredPane);
     }
 
     /**

@@ -747,24 +730,23 @@
      * This method is called by the constructor.
      * @param glassPane the <code>glassPane</code> object for this frame
      *
      * @see #getGlassPane
      * @see RootPaneContainer#setGlassPane
-     *
-     * @beaninfo
-     *     hidden: true
-     *     description: A transparent pane used for menu rendering.
      */
+    @BeanProperty(bound = false, hidden = true, description
+            = "A transparent pane used for menu rendering.")
     public void setGlassPane(Component glassPane) {
         getRootPane().setGlassPane(glassPane);
     }
 
     /**
      * {@inheritDoc}
      *
      * @since 1.6
      */
+    @BeanProperty(bound = false)
     public Graphics getGraphics() {
         JComponent.getGraphicsInvoked(this);
         return super.getGraphics();
     }