本文整理汇总了Java中javax.swing.AbstractButton.setBorderPainted方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractButton.setBorderPainted方法的具体用法?Java AbstractButton.setBorderPainted怎么用?Java AbstractButton.setBorderPainted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.AbstractButton
的用法示例。
在下文中一共展示了AbstractButton.setBorderPainted方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeButtonContentAreaAndBorder
import javax.swing.AbstractButton; //导入方法依赖的package包/类
private static void removeButtonContentAreaAndBorder(AbstractButton button) {
boolean canRemove = true;
if (button instanceof JToggleButton) {
canRemove = !button.isSelected();
}
if (canRemove) {
button.setContentAreaFilled(false);
button.setBorderPainted(false);
}
}
示例2: installUI
import javax.swing.AbstractButton; //导入方法依赖的package包/类
@Override
public void installUI(JComponent c) {
super.installUI(c);
c.setBorder(null);
if (c instanceof AbstractButton) {
AbstractButton btn = (AbstractButton) c;
//btn.setMargin(new Insets(10,10,10,10));
btn.setBorder(new EmptyBorder(5, 10, 5, 10));
// btn.setIcon(new XDMBlankIcon(15, 10));
btn.setBorderPainted(false);
// btn.setMargin(new Insets(10, 10, 10, 10));
// btn.setFont(new Font(Font.DIALOG, Font.PLAIN, 12));
}
// this.lightColor = Color.WHITE;
// this.darkColor = new Color(230, 230, 230);
// this.lightColor2 = new Color(245, 245, 245);
// chkIcon = UIManager.getIcon("CheckBoxMenuItem.checkIcon");
}
示例3: mouseEntered
import javax.swing.AbstractButton; //导入方法依赖的package包/类
@Override
public void mouseEntered(MouseEvent evt) {
Object src = evt.getSource();
if (src instanceof AbstractButton) {
AbstractButton button = (AbstractButton) evt.getSource();
if (button.isEnabled()) {
button.setContentAreaFilled(true);
button.setBorderPainted(true);
}
}
}
示例4: mouseEntered
import javax.swing.AbstractButton; //导入方法依赖的package包/类
public @Override void mouseEntered(MouseEvent evt) {
Object src = evt.getSource();
if (src instanceof AbstractButton) {
AbstractButton button = (AbstractButton)evt.getSource();
if (button.isEnabled()) {
button.setContentAreaFilled(true);
button.setBorderPainted(true);
}
}
}
示例5: mouseExited
import javax.swing.AbstractButton; //导入方法依赖的package包/类
@Override
public void mouseExited(MouseEvent evt) {
Object src = evt.getSource();
if (src instanceof AbstractButton) {
AbstractButton button = (AbstractButton) evt.getSource();
button.setContentAreaFilled(false);
button.setBorderPainted(false);
}
}
示例6: 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);
}
示例7: mouseEntered
import javax.swing.AbstractButton; //导入方法依赖的package包/类
@Override
public void mouseEntered(final MouseEvent e) {
final Component c = e.getComponent();
if (c instanceof AbstractButton) {
final AbstractButton ab = (AbstractButton) c;
ab.setBorderPainted(true);
}
}
示例8: mouseExited
import javax.swing.AbstractButton; //导入方法依赖的package包/类
@Override
public void mouseExited(final MouseEvent e) {
final Component c = e.getComponent();
if (c instanceof AbstractButton) {
final AbstractButton ab = (AbstractButton) c;
ab.setBorderPainted(false);
}
}
示例9: 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());
}
});
}
示例10: mouseEntered
import javax.swing.AbstractButton; //导入方法依赖的package包/类
public void mouseEntered(MouseEvent e) {
Component component = e.getComponent();
if (component instanceof AbstractButton) {
AbstractButton button = (AbstractButton) component;
button.setBorderPainted(true);
}
}
示例11: mouseExited
import javax.swing.AbstractButton; //导入方法依赖的package包/类
public void mouseExited(MouseEvent e) {
Component component = e.getComponent();
if (component instanceof AbstractButton) {
AbstractButton button = (AbstractButton) component;
button.setBorderPainted(false);
}
}
示例12: mouseEntered
import javax.swing.AbstractButton; //导入方法依赖的package包/类
@Override
public void mouseEntered(MouseEvent e) {
Component component = e.getComponent();
if (component instanceof AbstractButton) {
AbstractButton button = (AbstractButton) component;
button.setBorderPainted(true);
}
}
示例13: mouseExited
import javax.swing.AbstractButton; //导入方法依赖的package包/类
@Override
public void mouseExited(MouseEvent e) {
Component component = e.getComponent();
if (component instanceof AbstractButton) {
AbstractButton button = (AbstractButton) component;
button.setBorderPainted(false);
}
}