Java 如何更改鼠标进入/鼠标退出时按钮的图标图像?
我想改变鼠标上的一个按钮的图标图像进入和鼠标退出Java 如何更改鼠标进入/鼠标退出时按钮的图标图像?,java,swing,icons,jbutton,mouselistener,Java,Swing,Icons,Jbutton,Mouselistener,我想改变鼠标上的一个按钮的图标图像进入和鼠标退出 private void jButton1MouseEntered(java.awt.event.MouseEvent evt) { this.jButton1.setBackground(Color.red); this.jButton1.setForeground(Color.BLUE) } ; private void jButton1MouseExited(java.awt.event.Mous
private void jButton1MouseEntered(java.awt.event.MouseEvent evt) {
this.jButton1.setBackground(Color.red);
this.jButton1.setForeground(Color.BLUE)
} ;
private void jButton1MouseExited(java.awt.event.MouseEvent evt) {
this.jButton1.setBackground(Color.lightGray);
this.jButton1.setForeground(Color.BLACK);
}
请建议如何更改图标图像。请参阅(无需使用鼠标侦听器)