作者lovesneakers (sneakers)
站内java
标题Re: [问题] JButton getGraphics
时间Sun Apr 27 02:46:39 2008
谢谢 willieliao & janyfor
现在我知道只有继承才办得到额外再画图形上去
但其实我想要达到的是
CustomButton cBtn; // 假设这个是别人提供的 btn, 已经画了一个图案在上面
我要怎麽产生一个 JButton nBtn, 偷 cBtn 上面的图示, 并画到 nBtn 上面
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.113.191.75
1F:推 willieliao:一样,class nBtn extends cBtn { public void paint 04/27 13:26
2F:→ willieliao:(g) {super.paint(g) //後面再加上你自己要加画的 04/27 13:27
3F:推 willieliao:或者如果只是要偷图示用cBtn.getIcon()在set到nBtn上 04/27 13:31