本文整理汇总了Java中javax.swing.AbstractButton.setBorder方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractButton.setBorder方法的具体用法?Java AbstractButton.setBorder怎么用?Java AbstractButton.setBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.AbstractButton
的用法示例。
在下文中一共展示了AbstractButton.setBorder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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");
}
示例2: installButtonUI
import javax.swing.AbstractButton; //导入方法依赖的package包/类
@Override
public void installButtonUI(AbstractButton button) {
button.setUI(new ButtonUI());
button.setBorder(null);
button.setMargin(new Insets(0, 0, 0, 0));
if ((button.getText() == null || "".equals(button.getText())) && button.getIcon() != null) {
button.setPreferredSize(new Dimension((int) (button.getIcon().getIconWidth() * 1.45d), (int) (button.getIcon()
.getIconHeight() * 1.45d)));
}
}
示例3: installUI
import javax.swing.AbstractButton; //导入方法依赖的package包/类
@Override
public void installUI (JComponent c) {
super.installUI(c);
AbstractButton button = (AbstractButton) c;
button.setOpaque (false);
button.setBorder (BorderFactory.createEmptyBorder (7, 17, 7, 17));
}
示例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: installBorder
import javax.swing.AbstractButton; //导入方法依赖的package包/类
/** Install a border on the button */
protected void installBorder (AbstractButton b) {
b.setBorder (BorderFactory.createEtchedBorder());
}