BorderLayout layout = panel.getLayout(); panel.removeLayoutComponent(layout.getLayoutComponent(BorderLayout.CENTER));
PanelPreferences.this.remove(borderLayoutPreferences.getLayoutComponent(BorderLayout.CENTER)); PanelPreferences.this.add(categories.getSelectedValue().getPanel(), BorderLayout.CENTER);
BorderLayout layout = (BorderLayout) frmAdmin.getContentPane().getLayout(); return (JPanel) layout.getLayoutComponent(BorderLayout.CENTER);
final BorderLayout layout = (BorderLayout) frame.getContentPane().getLayout(); final Component west = layout.getLayoutComponent(BorderLayout.WEST);
JFileChooser fc = new JFileChooser(); //get the center component BorderLayout layout = (BorderLayout) fc.getLayout(); JComponent comp = (JComponent) layout.getLayoutComponent(BorderLayout.CENTER); layout = (BorderLayout) comp.getLayout(); comp = (JComponent) layout.getLayoutComponent(BorderLayout.CENTER); //add my panel at the bottom comp.add(panel, BorderLayout.SOUTH);
private void removeCenterBody() { Component old = ((BorderLayout)bodyPanel.getLayout()).getLayoutComponent(BorderLayout.CENTER); if( old != null ) { bodyPanel.remove(old); } } }
private void removeCenterBody() { Component old = ((BorderLayout)bodyPanel.getLayout()).getLayoutComponent(BorderLayout.CENTER); if( old != null ) { bodyPanel.remove(old); } } }
private boolean isBlocked(Component comp, Object constraint) { if (comp instanceof Container) { Container cont = (Container) comp; LayoutManager lm = cont.getLayout(); if (lm instanceof BorderLayout) { BorderLayout blm = (BorderLayout) lm; Component c = blm.getLayoutComponent(cont, constraint); return (c != null && c != toolBar); } } return false; }
public void setEditorComponent(JComponent editor) { BorderLayout layout = (BorderLayout) outerMostPanel.getLayout(); String EDITOR_SPOT_COMPONENT = BorderLayout.CENTER; // atomically remove old synchronized (swapEditorComponentLock) { Component editorSpotComp = layout.getLayoutComponent(EDITOR_SPOT_COMPONENT); if ( editorSpotComp!=null ) { editorSpotComp.setVisible(false); outerMostPanel.remove(editorSpotComp); // remove old editor if it's there } outerMostPanel.add(editor, EDITOR_SPOT_COMPONENT); } }
public void setTopComponent(JComponent aComp) { checkCenterComponent(); BorderLayout layout = (BorderLayout) super.getLayout(); java.awt.Component oldComp = layout.getLayoutComponent(BorderLayout.NORTH); if (oldComp == null) { oldComp = layout.getLayoutComponent(BorderLayout.PAGE_START); } if (oldComp != null) { super.remove(oldComp); super.revalidate(); super.repaint(); } add(aComp, VerticalPosition.TOP); }
@ScriptFunction(jsDoc = BOTTOM_COMPONENT_JSDOC) @Undesignable public JComponent getBottomComponent() { BorderLayout layout = (BorderLayout) super.getLayout(); java.awt.Component target = layout.getLayoutComponent(BorderLayout.SOUTH); if (target == null) { target = layout.getLayoutComponent(BorderLayout.PAGE_END); } return (JComponent) target; }
@ScriptFunction(jsDoc = TOP_COMPONENT_JSDOC) @Undesignable public JComponent getTopComponent() { BorderLayout layout = (BorderLayout) super.getLayout(); java.awt.Component target = layout.getLayoutComponent(BorderLayout.NORTH); if (target == null) { target = layout.getLayoutComponent(BorderLayout.PAGE_START); } return (JComponent) target; }
@ScriptFunction(jsDoc = LEFT_COMPONENT_JSDOC) @Undesignable public JComponent getLeftComponent() { BorderLayout layout = (BorderLayout) super.getLayout(); java.awt.Component target = layout.getLayoutComponent(BorderLayout.WEST); if (target == null) { target = layout.getLayoutComponent(BorderLayout.LINE_START); } return (JComponent) target; }
@ScriptFunction(jsDoc = RIGHT_COMPONENT_JSDOC) @Undesignable public JComponent getRightComponent() { BorderLayout layout = (BorderLayout) super.getLayout(); java.awt.Component target = layout.getLayoutComponent(BorderLayout.EAST); if (target == null) { target = layout.getLayoutComponent(BorderLayout.LINE_END); } return (JComponent) target; }
@ScriptFunction public void setRightComponent(JComponent aComp) { checkCenterComponent(); BorderLayout layout = (BorderLayout) super.getLayout(); java.awt.Component oldComp = layout.getLayoutComponent(BorderLayout.EAST); if (oldComp == null) { oldComp = layout.getLayoutComponent(BorderLayout.LINE_END); } if (oldComp != null) { super.remove(oldComp); super.revalidate(); super.repaint(); } add(aComp, HorizontalPosition.RIGHT); }
@ScriptFunction public void setCenterComponent(JComponent aComp) { checkCenterComponent(); BorderLayout layout = (BorderLayout) super.getLayout(); java.awt.Component oldComp = layout.getLayoutComponent(BorderLayout.CENTER); if (oldComp != null) { super.remove(oldComp); super.revalidate(); super.repaint(); } add(aComp, VerticalPosition.CENTER); }
@ScriptFunction(jsDoc = CENTER_COMPONENT_JSDOC) @Undesignable public JComponent getCenterComponent() { BorderLayout layout = (BorderLayout) super.getLayout(); return (JComponent) layout.getLayoutComponent(BorderLayout.CENTER); }
public void run() { listModel.addElement(name); if (listModel.size() == 1) { listPanel.setSelectedIndex(0); } // update the list's size Dimension d = listPanel.getMinimumSize(); listPanel.setPreferredSize(new Dimension(d.width + scroll.getVerticalScrollBar().getWidth(), d.height)); // make sure it's preferred size is up to date if( sizeChanged ) { Component old = ((BorderLayout) bodyPanel.getLayout()).getLayoutComponent(BorderLayout.CENTER); if (old != null) { old.setPreferredSize(new Dimension(bodyWidth, bodyHeight)); } } validate(); } });
public void run() { listModel.addElement(name); if (listModel.size() == 1) { listPanel.setSelectedIndex(0); } // update the list's size Dimension d = listPanel.getMinimumSize(); listPanel.setPreferredSize(new Dimension(d.width + scroll.getVerticalScrollBar().getWidth(), d.height)); // make sure it's preferred size is up to date Component old = ((BorderLayout) bodyPanel.getLayout()).getLayoutComponent(BorderLayout.CENTER); if (old != null) old.setPreferredSize(new Dimension(bodyWidth, bodyHeight)); validate(); } });
@Override public void mouseEntered(MouseEvent e) { if (stashTabDescriptor.isQuad()) { remove(((BorderLayout) getLayout()).getLayoutComponent(BorderLayout.CENTER)); add(quadTabGrid, BorderLayout.CENTER); } else { remove(((BorderLayout) getLayout()).getLayoutComponent(BorderLayout.CENTER)); add(defaultGrid, BorderLayout.CENTER); } MercuryStoreUI.repaintSubject.onNext(ItemsGridFrame.class); } });