本文整理了Java中javax.swing.JRadioButton.getFont()
方法的一些代码示例,展示了JRadioButton.getFont()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JRadioButton.getFont()
方法的具体详情如下:
包路径:javax.swing.JRadioButton
类名称:JRadioButton
方法名:getFont
暂无
代码示例来源: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
boolean previousState = rb.isSelected();
rb.setSelected(false);
FontMetrics boxFontMetrics = rb.getFontMetrics(rb.getFont());
Icon radioIcon = UIManager.getIcon("RadioButton.icon");
BufferedImage radioImage = new BufferedImage(
代码示例来源:origin: MegaMek/mekhq
private JRadioButton createOptionRadioButton(String text, Icon checkboxIcon, Icon checkboxSelectedIcon) {
JRadioButton radioButton = new JRadioButton(text);
radioButton.setOpaque(false);
radioButton.setForeground(new Color(150, 220, 255));
radioButton.setFocusable(false);
radioButton.setFont(radioButton.getFont().deriveFont(Font.BOLD));
radioButton.setPreferredSize(new Dimension(150, 20));
radioButton.setIcon(checkboxIcon);
radioButton.setSelectedIcon(checkboxSelectedIcon);
radioButton.setSelected(false);
radioButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
repaint();
}
});
return radioButton;
}
代码示例来源:origin: xyz.cofe/gui.swing
italicRB.setFont(italicRB.getFont().deriveFont((italicRB.getFont().getStyle() | java.awt.Font.ITALIC)));
italicRB.setText("Italic");
gridBagConstraints = new java.awt.GridBagConstraints();
boldRB.setFont(boldRB.getFont().deriveFont(boldRB.getFont().getStyle() | java.awt.Font.BOLD));
boldRB.setText("Bold");
gridBagConstraints = new java.awt.GridBagConstraints();
italicBoldRB.setFont(italicBoldRB.getFont().deriveFont((italicBoldRB.getFont().getStyle() | java.awt.Font.ITALIC) | java.awt.Font.BOLD));
italicBoldRB.setText("Italic Bold");
gridBagConstraints = new java.awt.GridBagConstraints();
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javafx2-project
radioButtonSA.setFont(radioButtonSA.getFont().deriveFont(radioButtonSA.getFont().getStyle() | java.awt.Font.BOLD));
radioButtonSA.setSelected(true);
org.openide.awt.Mnemonics.setLocalizedText(radioButtonSA, org.openide.util.NbBundle.getMessage(JFXRunPanel.class, "JFXRunPanel.radioButtonSA.text")); // NOI18N
内容来源于网络,如有侵权,请联系作者删除!