开发者

Draw Image of Userinterface onto Glasspane

开发者 https://www.devze.com 2023-03-10 14:08 出处:网络
I\'m trying t开发者_C百科o draw a modified version of my GUI onto the Glasspane. My idea is to have a panel where I override the paint function, but when I trysomething like

I'm trying t开发者_C百科o draw a modified version of my GUI onto the Glasspane. My idea is to have a panel where I override the paint function, but when I trysomething like

glass = frame.getGlasspane();
glass.draw(g);

I get a Nullpointer Exception, even though I initialized the glasspane with frame.setGlasspane(new JPanel());

Thanks for your help


please read How to Use Root Panes follows example, example about paint(Graphics g) or here

0

精彩评论

暂无评论...
验证码 换一张
取 消