本文整理汇总了Java中javax.swing.AbstractButton.setFocusable方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractButton.setFocusable方法的具体用法?Java AbstractButton.setFocusable怎么用?Java AbstractButton.setFocusable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.AbstractButton
的用法示例。
在下文中一共展示了AbstractButton.setFocusable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureToolbarButton
import javax.swing.AbstractButton; //导入方法依赖的package包/类
private void configureToolbarButton (AbstractButton item, String containerCtx, String action, ActionProvider provider, Map ctx) {
item.setFocusable(false);
item.setName(action);
item.putClientProperty (KEY_ACTION, action);
item.setToolTipText(
provider.getDisplayName(action, containerCtx));
// item.setToolTipText(provider.getDescription(action, containerCtx));
int state = ctx == null ? ActionProvider.STATE_VISIBLE :
provider.getState (action, containerCtx, ctx);
boolean enabled = (state & ActionProvider.STATE_ENABLED) != 0;
item.setEnabled(enabled);
boolean visible = (state & ActionProvider.STATE_VISIBLE) != 0;
item.setVisible (visible);
boolean toggled = (state & ActionProvider.STATE_SELECTED) != 0;
item.setSelected(toggled);
// item.setMnemonic(provider.getMnemonic(action, containerCtx));
// item.setDisplayedMnemonicIndex(provider.getMnemonicIndex(action, containerCtx));
item.setIcon(provider.getIcon(action, containerCtx, BeanInfo.ICON_COLOR_16x16));
}
示例2: processButton
import javax.swing.AbstractButton; //导入方法依赖的package包/类
private void processButton(AbstractButton button) {
removeButtonContentAreaAndBorder(button);
button.setMargin(BUTTON_INSETS);
if (button instanceof AbstractButton) {
button.addMouseListener(sharedMouseListener);
}
//fix of issue #69642. Focus shouldn't stay in toolbar
button.setFocusable(false);
}
示例3: processButton
import javax.swing.AbstractButton; //导入方法依赖的package包/类
private void processButton(AbstractButton button) {
button.setContentAreaFilled(false);
button.setBorderPainted(false);
button.setMargin(BUTTON_INSETS);
if (button instanceof AbstractButton) {
button.addMouseListener(sharedMouseListener);
}
//Focus shouldn't stay in toolbar
button.setFocusable(false);
}
示例4: setLAF
import javax.swing.AbstractButton; //导入方法依赖的package包/类
/** Gives a button the Groove look-and-feel. */
static public void setLAF(final AbstractButton button) {
button.setHideActionText(true);
button.setFocusable(false);
button.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(),
BorderFactory.createEmptyBorder(3, 2, 3, 2)));
button.setBorderPainted(button.isEnabled());
button.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
button.setBorderPainted(button.isEnabled());
}
});
}
示例5: processButton
import javax.swing.AbstractButton; //导入方法依赖的package包/类
private static void processButton(AbstractButton button) {
removeButtonContentAreaAndBorder(button);
button.setMargin(BUTTON_INSETS);
button.addMouseListener(sharedMouseListener);
button.setFocusable(false);
}
示例6: installDefaults
import javax.swing.AbstractButton; //导入方法依赖的package包/类
/** Overridden to not call super.installDefaults() and only set the button
* to be non-focusable */
@Override
public void installDefaults (AbstractButton b) {
b.setFocusable (false);
}