【发布时间】:2017-11-18 04:09:20
【问题描述】:
我所指的重点:
当我点击使用以下代码的 JButton 时:
public static JButton addButton(JPanel panel, String text, Point pos, int width, int height, ActionListener action)
{
JButton button = new JButton(text);
button.setBounds(pos.x, pos.y, width, height);
button.addActionListener(action);
button.setVisible(true);
button.setBackground(new Color(255, 137, 58));
button.setForeground(Color.white);
button.setBorder(new LineBorder(new Color(196, 96, 29), 2));
button.setRolloverEnabled(true);
panel.add(button, 3, 0);
return button;
}
文本框随后突出显示。有没有一种简单的方法可以消除这种影响?
【问题讨论】:
标签: java text jbutton highlight