本文整理汇总了Java中javax.swing.JRadioButton.setToolTipText方法的典型用法代码示例。如果您正苦于以下问题:Java JRadioButton.setToolTipText方法的具体用法?Java JRadioButton.setToolTipText怎么用?Java JRadioButton.setToolTipText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JRadioButton
的用法示例。
在下文中一共展示了JRadioButton.setToolTipText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addComponent
import javax.swing.JRadioButton; //导入方法依赖的package包/类
/**
* This method allows to add a component to this container. Hence the container provides radio
* buttons to toggle between components, it is needed to specify a name for the components and
* toolTips.
*
* @param selectionName
* is the name of the component
* @param component
* is the component to add
* @param toolTip
* is the tool tip of corresponding radio button
*/
public void addComponent(String selectionName, Component component, String toolTip) {
boolean isFirstButton = buttonComponentMap.size() == 0;
final JRadioButton selectionButton = new JRadioButton(selectionName, isFirstButton);
buttonComponentMap.put(selectionButton, component);
selectionButton.setToolTipText(toolTip);
selectionButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (selectionButton.isSelected()) {
remove(1);
add(buttonComponentMap.get(selectionButton), BorderLayout.CENTER);
repaint();
}
}
});
toggleButtons.add(selectionButton);
togglePanel.add(selectionButton);
if (isFirstButton) {
selectionButton.setSelected(true);
add(component, BorderLayout.CENTER);
}
}
示例2: createRadioButton
import javax.swing.JRadioButton; //导入方法依赖的package包/类
public static JRadioButton createRadioButton(String text, String toolTip) {
JRadioButton button = new JRadioButton();
Mnemonics.setLocalizedText(button, text);
button.setText(cutMnemonicAndAmpersand(text));
button.setToolTipText(toolTip);
return button;
}
示例3: makeGUIControl
import javax.swing.JRadioButton; //导入方法依赖的package包/类
@Override
public JRadioButton makeGUIControl() {
final JRadioButton but = new JRadioButton("<html>" + getName() + ": " + getDescription());
but.setToolTipText("<html>" + toString() + "<br>Select to set bit, clear to clear bit.");
but.setSelected(value);
but.setAlignmentX(Component.LEFT_ALIGNMENT);
but.addActionListener(new SPIConfigBitAction(this));
setControl(but);
addObserver(biasgen); // This observer is responsible for sending data to hardware
addObserver(this); // This observer is responsible for GUI update. It calls the updateControl() method
return but;
}