javax.swing.JRadioButton.getPreferredSize()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中javax.swing.JRadioButton.getPreferredSize()方法的一些代码示例,展示了JRadioButton.getPreferredSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JRadioButton.getPreferredSize()方法的具体详情如下:
包路径:javax.swing.JRadioButton
类名称:JRadioButton
方法名:getPreferredSize

JRadioButton.getPreferredSize介绍

暂无

代码示例

代码示例来源:origin: JetBrains/jediterm

@Override
public Dimension getPreferredSize() {
 return myAnchor == null || myAnchor == this ? super.getPreferredSize() : myAnchor.getPreferredSize();
}

代码示例来源:origin: triplea-game/triplea

private static int getRadioButtonLabelHorizontalOffset() {
 final JRadioButton radioButton = new JRadioButton("\u200B"); // zero-width space
 return radioButton.getPreferredSize().width - radioButton.getInsets().right;
}

代码示例来源:origin: com.synaptix/SynaptixSwing

public DefaultRadioButtonFilter(String id, String name, int width,
String title, boolean useDefault, Boolean defaultValue) {
  super();
  this.id = id;
  this.name = name;
  radioButton = new JRadioButton(title == null ? "" : title);
  radioButton.setPreferredSize(new Dimension(width, radioButton
  .getPreferredSize().height));
  if (useDefault) {
    defaultRadioButton = new JRadioButton(title == null ? "Coche"
    : title);
    defaultRadioButton.setPreferredSize(new Dimension(width,
    defaultRadioButton.getPreferredSize().height));
    setDefaultValue(defaultValue);
  }
  initialize();
}

代码示例来源:origin: stackoverflow.com

JRadioButton jrb = new JRadioButton();
   int width = (int) SwingUtilities2.getFontMetrics( jrb, jrb.getFont() ).getStringBounds( cat.getDescription(), null ).getWidth();
   for (Case c : cases) {
     JRadioButton jrbCase = new JRadioButton();
     jrbCase.setText(c.getDescription());
     jrbCase.setToolTipText(c.getText());
     jrbCase.setPreferredSize( new Dimension( width, jrbCase.getPreferredSize().height ) );
     bgCases.add(jrbCase);
     jp.add(jrbCase);
   }

代码示例来源:origin: stackoverflow.com

Dimension dim = radioButton.getPreferredSize();
int x = (getWidth() - dim.width) / 2;
int y = (getHeight() - dim.height) / 2;

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-profiler

c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.HORIZONTAL;
c.insets = new Insets(0, 15 + new JRadioButton("").getPreferredSize().width, 5, 5); // NOI18N
add(customLocationField, c);

代码示例来源:origin: igvteam/igv

forwardRadio.setSelected(true);
contentPanel.add(forwardRadio);
forwardRadio.setBounds(65, 180, forwardRadio.getPreferredSize().width, 23);
reverseRadio.setBounds(145, 180, reverseRadio.getPreferredSize().width, 23);

代码示例来源:origin: net.java.dev.jets3t/jets3t

1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsZero, 0, 0));
int textOffset = changedNamesRadioButton.getIconTextGap()
  + (int) changedNamesRadioButton.getPreferredSize().getHeight();
renamePanel.add(renamePatternTextField, new GridBagConstraints(0, 2,
  1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-profiler

c.anchor = GridBagConstraints.NORTHWEST;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(0, 15 + new JRadioButton("").getPreferredSize().width, 5, 10); // NOI18N
add(projectSnapshotsListScroll, c);
c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.NONE;
c.insets = new Insets(0, 15 + new JRadioButton("").getPreferredSize().width, 5, 10); // NOI18N
add(projectSnapshotsHintLabel, c);
c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.HORIZONTAL;
c.insets = new Insets(0, 15 + new JRadioButton("").getPreferredSize().width, 5, 5); // NOI18N
add(externalFileField, c);
c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.NONE;
c.insets = new Insets(0, 15 + new JRadioButton("").getPreferredSize().width, 5, 10); // NOI18N
add(externalFileHintLabel, c);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsZero, 0, 0));
int textOffset = changedNamesRadioButton.getIconTextGap()
  + (int) changedNamesRadioButton.getPreferredSize().getHeight();
renamePanel.add(renamePatternTextField, new GridBagConstraints(0, 2,
  1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,

相关文章

JRadioButton类方法