问大家个PC上JAVA程序的问题 之前是这样的

把鼠标放上去世这样的

这个是什么控件?
或者说怎样实现的 有代码么
java 图标按钮控件
------解决方案--------------------
没必要重复发帖子。。。看帖子的就那么几个。。
GUI中
你给这个按钮添加一个鼠标位置监听器,
你把鼠标放上去,触发这个监听,然后换背景图片就行
------解决方案--------------------
package mkdemo;
import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.JPanel;
public class MouseMonitor extends JPanel {
protected int _xPos
protected int _yPos;
public void tellMouseInfo(int x, int y) {
_xPos = x;
_yPos = y;
repaint();
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
StringBuffer sbuf = new StringBuffer();
sbuf.append("Mouse Location on screen: x = ");
sbuf.append(String.valueOf(_xPos));
sbuf.append(", y = ");
sbuf.append(String.valueOf(_yPos));
Rectangle rect = this.getBounds();
g.drawString(sbuf.toString(), rect.x+20, (rect.y+rect.height)/2);
}
}
------解决方案--------------------
《swing也惊艳》看看如何使界面变漂亮:http://blog.csdn.net/withiter/article/details/7231394