本文整理了Java中javax.swing.JPanel.getParent()
方法的一些代码示例,展示了JPanel.getParent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JPanel.getParent()
方法的具体详情如下:
包路径:javax.swing.JPanel
类名称:JPanel
方法名:getParent
暂无
代码示例来源:origin: apache/pdfbox
@Override
public void actionPerformed(ActionEvent actionEvent)
{
panel.setVisible(false);
closeAction.setEnabled(false);
panel.getParent().transferFocus();
}
};
代码示例来源:origin: apache/pdfbox
@Override
public void actionPerformed(ActionEvent actionEvent)
{
if (!panel.isVisible())
{
panel.setVisible(true);
panel.getParent().validate();
return;
}
reFocus();
}
};
代码示例来源:origin: nodebox/nodebox
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);
}
代码示例来源:origin: stackoverflow.com
Container parent = panel.getParent();
if (parent != null) {
代码示例来源:origin: misakuo/svgtoandroid
@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);
}
});
代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client
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();
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
private void revalidateDetailsPanel() {
detailsPanel.invalidate();
repaint();
if (detailsPanel.getParent() != null) {
detailsPanel.getParent().validate();
} else {
detailsPanel.validate();
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
private void revalidateDetailsPanel() {
detailsPanel.invalidate();
repaint();
if (detailsPanel.getParent() != null) {
detailsPanel.getParent().validate();
} else {
detailsPanel.validate();
}
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
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
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
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
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction
@Override
public void setTop(int aValue) {
if (super.getParent() != null && super.getParent().getLayout() instanceof MarginLayout) {
MarginLayout.ajustTop(this, aValue);
}
super.setLocation(getLeft(), aValue);
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction
@Override
public void setLeft(int aValue) {
if (super.getParent() != null && super.getParent().getLayout() instanceof MarginLayout) {
MarginLayout.ajustLeft(this, aValue);
}
super.setLocation(aValue, getTop());
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction
@Override
public void setLeft(int aValue) {
if (super.getParent() != null && super.getParent().getLayout() instanceof MarginLayout) {
MarginLayout.ajustLeft(this, aValue);
}
super.setLocation(aValue, getTop());
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction
@Override
public void setTop(int aValue) {
if (super.getParent() != null && super.getParent().getLayout() instanceof MarginLayout) {
MarginLayout.ajustTop(this, aValue);
}
super.setLocation(getLeft(), aValue);
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction
@Override
public void setLeft(int aValue) {
if (super.getParent() != null && super.getParent().getLayout() instanceof MarginLayout) {
MarginLayout.ajustLeft(this, aValue);
}
super.setLocation(aValue, getTop());
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction
@Override
public void setLeft(int aValue) {
if (super.getParent() != null && super.getParent().getLayout() instanceof MarginLayout) {
MarginLayout.ajustLeft(this, aValue);
}
super.setLocation(aValue, getTop());
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction
@Override
public void setLeft(int aValue) {
if (super.getParent() != null && super.getParent().getLayout() instanceof MarginLayout) {
MarginLayout.ajustLeft(this, aValue);
}
super.setLocation(aValue, getTop());
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction
@Override
public void setTop(int aValue) {
if (super.getParent() != null && super.getParent().getLayout() instanceof MarginLayout) {
MarginLayout.ajustTop(this, aValue);
}
super.setLocation(getLeft(), aValue);
}
代码示例来源:origin: stackoverflow.com
JButton button = (JButton)e.getSource();
JPanel buttonPanel = (JPanel)button.getParent();
JPanel cardLayoutPanel = (JPanel)buttonPanel.getParent();
CardLayout layout = (CardLayout)cardLayoutPanel.getLayout();
layout.show(cardLayoutPanel, "2");
代码示例来源:origin: org.softsmithy.lib/lib-core
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");
}
}
});
内容来源于网络,如有侵权,请联系作者删除!