/** * Specifies the menu bar value. * * @deprecated As of Swing version 1.0.3 replaced by <code>setJMenuBar(JMenuBar menu)</code>. * @param menu the <code>JMenuBar</code> to add. */ @Deprecated public void setMenuBar(JMenuBar menu) { if (menuBar != null && menuBar.getParent() == layeredPane) layeredPane.remove(menuBar); menuBar = menu; if (menuBar != null) layeredPane.add(menuBar, JLayeredPane.FRAME_CONTENT_LAYER); }
/** * Sets the content pane -- the container that holds the components parented by the root pane. * * <p>Swing's painting architecture requires an opaque <code>JComponent</code> in the containment * hierarchy. This is typically provided by the content pane. If you replace the content pane it * is recommended you replace it with an opaque <code>JComponent</code>. * * @param content the <code>Container</code> to use for component-contents * @exception java.awt.IllegalComponentStateException (a runtime exception) if the content pane * parameter is <code>null</code> */ public void setContentPane(Container content) { if (content == null) throw new IllegalComponentStateException("contentPane cannot be set to null."); if (contentPane != null && contentPane.getParent() == layeredPane) layeredPane.remove(contentPane); contentPane = content; layeredPane.add(contentPane, JLayeredPane.FRAME_CONTENT_LAYER); }
/** * Sets the window title pane -- the JComponent used to provide a plaf a way to override the * native operating system's window title pane with one whose look and feel are controlled by the * plaf. The plaf creates and sets this value; the default is null, implying a native operating * system window title pane. * * @param content the <code>JComponent</code> to use for the window title pane. */ private void setTitlePane(JRootPane root, JComponent titlePane) { JLayeredPane layeredPane = root.getLayeredPane(); JComponent oldTitlePane = getTitlePane(); if (oldTitlePane != null) { oldTitlePane.setVisible(false); layeredPane.remove(oldTitlePane); } if (titlePane != null) { layeredPane.add(titlePane, JLayeredPane.FRAME_CONTENT_LAYER); titlePane.setVisible(true); } this.titlePane = titlePane; }
private void finishDragging() { if (!isDraggingNow()) return; myDragPane.remove(myDragButtonImage); myDragButtonImage = null; myPane.stopDrag(); myDragPane.repaint(); setVisible(true); if (myLastStripe != null) { myLastStripe.finishDrop(); myLastStripe = null; } if (myDragKeyEventDispatcher != null) { KeyboardFocusManager.getCurrentKeyboardFocusManager() .removeKeyEventDispatcher(myDragKeyEventDispatcher); myDragKeyEventDispatcher = null; } }
public void removeFromServer(PlayerMob plyr) { layeredPane.remove(plyr); }