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

Print this page

        

*** 34,49 **** import java.awt.HeadlessException; import java.awt.Image; import java.awt.LayoutManager; import java.awt.event.WindowEvent; 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 --- 34,51 ---- 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,128 **** * @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 */ @SuppressWarnings("serial") // Same-version serialization only public class JFrame extends Frame implements WindowConstants, Accessible, RootPaneContainer, TransferHandler.HasGetTransferHandler --- 111,127 ---- * @see JRootPane * @see #setDefaultCloseOperation * @see java.awt.event.WindowListener#windowClosing * @see javax.swing.RootPaneContainer * * @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,395 **** * @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. */ public void setDefaultCloseOperation(int operation) { if (operation != DO_NOTHING_ON_CLOSE && operation != HIDE_ON_CLOSE && operation != DISPOSE_ON_CLOSE && operation != EXIT_ON_CLOSE) { --- 375,391 ---- * @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) */ + @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,461 **** * * @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 */ public void setTransferHandler(TransferHandler newHandler) { TransferHandler oldHandler = transferHandler; transferHandler = newHandler; SwingUtilities.installSwingDropTargetAsNecessary(this, transferHandler); firePropertyChange("transferHandler", oldHandler, newHandler); --- 442,454 ---- * * @see TransferHandler * @see #getTransferHandler * @see java.awt.Component#setDropTarget * @since 1.6 */ + @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,501 **** /** * 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. */ public void setJMenuBar(JMenuBar menubar) { getRootPane().setMenuBar(menubar); } /** --- 480,492 ---- /** * Sets the menubar for this frame. * @param menubar the menubar being placed in the frame * * @see #getJMenuBar */ + @BeanProperty(bound = false, hidden = true, description + = "The menubar for accessing pulldown menus from this frame.") public void setJMenuBar(JMenuBar menubar) { getRootPane().setMenuBar(menubar); } /**
*** 535,548 **** * * @see #addImpl * @see #setLayout * @see #isRootPaneCheckingEnabled * @see javax.swing.RootPaneContainer - * @beaninfo - * hidden: true - * description: Whether the add and setLayout methods are forwarded */ protected void setRootPaneCheckingEnabled(boolean enabled) { rootPaneCheckingEnabled = enabled; } --- 526,538 ---- * * @see #addImpl * @see #setLayout * @see #isRootPaneCheckingEnabled * @see javax.swing.RootPaneContainer */ + @BeanProperty(hidden = true, description + = "Whether the add and setLayout methods are forwarded") protected void setRootPaneCheckingEnabled(boolean enabled) { rootPaneCheckingEnabled = enabled; }
*** 622,631 **** --- 612,623 ---- * @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,646 **** * 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); --- 625,634 ----
*** 690,705 **** * @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. */ public void setContentPane(Container contentPane) { getRootPane().setContentPane(contentPane); } /** --- 678,690 ---- * @exception java.awt.IllegalComponentStateException (a runtime * exception) if the content pane parameter is <code>null</code> * @see #getContentPane * @see RootPaneContainer#setContentPane * @see JRootPane */ + @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,734 **** * * @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. */ public void setLayeredPane(JLayeredPane layeredPane) { getRootPane().setLayeredPane(layeredPane); } /** --- 705,717 ---- * * @exception java.awt.IllegalComponentStateException (a runtime * exception) if the layered pane parameter is <code>null</code> * @see #getLayeredPane * @see RootPaneContainer#setLayeredPane */ + @BeanProperty(bound = false, hidden = true, description + = "The pane that holds the various frame layers.") public void setLayeredPane(JLayeredPane layeredPane) { getRootPane().setLayeredPane(layeredPane); } /**
*** 747,770 **** * 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. */ public void setGlassPane(Component glassPane) { getRootPane().setGlassPane(glassPane); } /** * {@inheritDoc} * * @since 1.6 */ public Graphics getGraphics() { JComponent.getGraphicsInvoked(this); return super.getGraphics(); } --- 730,752 ---- * This method is called by the constructor. * @param glassPane the <code>glassPane</code> object for this frame * * @see #getGlassPane * @see RootPaneContainer#setGlassPane */ + @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(); }