Draw Image of Userinterface onto Glasspane
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
精彩评论