请问这段Code如何实现在BUTTON CLICK事件中改变BUTTON BACKCOLOR? 设置Button的颜色?redButton.setBackground(Color.blue); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是不是这样:? public void actionPerformed(ActionEvent event) { ButtonPanel.this.setBackground(backgroundColor); Component[] buttonArray=ButtonPanel.this.getComponents(); for(int i=0;i<buttonArray.length;i++) ((JButton)buttonArray[i]).setBackground(Color.lightGray); JButton button=(JButton)event.getSource(); button.setBackground(backgroundColor); repaint(); } mybase打开文件出错,急,在线等~~~ 没分,怎么办啊 关于arrays.sort这个方法 SWING 难题难了我很久,我一个画面有很多,JLabel,JButton,JTable,等组建,当他们重合的时候,我要怎么控制控制他们谁显示在最上层, 推荐好书 对内部类的不解 JList项目文字对齐的问题? java书籍低价出售 求教 java连接oracle 执行问题 这个代码会出exception,还不会出结果,不知道怎么解决,求助 把分献给回答问题最清楚的那个人(对于你来说,可能超级简单) 初学者问题,希望大家指导指导
public void actionPerformed(ActionEvent event)
{
ButtonPanel.this.setBackground(backgroundColor);
Component[] buttonArray=ButtonPanel.this.getComponents();
for(int i=0;i<buttonArray.length;i++)
((JButton)buttonArray[i]).setBackground(Color.lightGray);
JButton button=(JButton)event.getSource();
button.setBackground(backgroundColor);
repaint();
}