@Override public void actionPerformed(ActionEvent actionEvent) { panel.setVisible(false); closeAction.setEnabled(false); panel.getParent().transferFocus(); } };
@Override public void actionPerformed(ActionEvent actionEvent) { if (!panel.isVisible()) { panel.setVisible(true); panel.getParent().validate(); return; } reFocus(); } };
private void updateExamplesPanelSize() { Component scrollPane = examplesPanel.getParent(); int scrollPaneWidth = scrollPane.getWidth(); ExampleLayout exampleLayout = (ExampleLayout) examplesPanel.getLayout(); int contentsHeight = exampleLayout.calculateHeight(examplesPanel, scrollPaneWidth); examplesPanel.setSize(scrollPaneWidth, contentsHeight); }
Container parent = panel.getParent(); if (parent != null) {
@Override public void actionPerformed(ActionEvent e) { Color c = ColorChooser.chooseColor(root.getParent(), "", saved); color.setBackground(c); color.setText("#" + Integer.toHexString(c.getRGB()).toUpperCase()); ensureTextColor(c); } });
public void setValue(String key, JComponent value) { JPanel p = keyValueComponentMap.get(key); p.removeAll(); p.add(value); p.add(Box.createHorizontalGlue()); p.repaint(); p.getParent().repaint(); }
private void detailsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_detailsButtonActionPerformed showingDetails = !showingDetails; if (showingDetails && !this.equals(detailsPanel.getParent())) { initDetails(); } updateButtonState(); updateDetailsPanel(); } //GEN-LAST:event_detailsButtonActionPerformed
private void detailsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_detailsButtonActionPerformed showingDetails = !showingDetails; if ( showingDetails && !this.equals( detailsPanel.getParent() ) ) { initDetails(); } updateButtonState(); updateDetailsPanel(); }//GEN-LAST:event_detailsButtonActionPerformed
JButton button = (JButton)e.getSource(); JPanel buttonPanel = (JPanel)button.getParent(); JPanel cardLayoutPanel = (JPanel)buttonPanel.getParent(); CardLayout layout = (CardLayout)cardLayoutPanel.getLayout(); layout.show(cardLayoutPanel, "2");
public void actionPerformed(ActionEvent e) { Color color = JColorChooser.showDialog(editor.getParent(), "Choose Color", getColor()); if (color != null) { setNewColor(color); stopCellEditing(); //System.out.println("Stop"); } else { cancelCellEditing(); //System.out.println("Cancel"); } } });