Can you tell me how to do like below in JAVA SWING.
问问题
3468 次
3 回答
2
JTextField textField = new JTextField() {
protected void paintComponent(Graphics g) {
super.paintComponent(g);
int y = (getHeight() - image.getHeight())/2;
g.drawImage(image, x0, y, this);
}
};
于 2013-09-11T09:55:07.343 回答
1
于 2013-09-11T09:55:29.093 回答
0
阅读本教程。他做你想做的事:http: //harryjoy.me/2012/07/14/jtextfield-with-image-inside-it/
于 2013-09-11T10:01:35.170 回答