62,615
社区成员
发帖
与我相关
我的任务
分享
JFrame jFrame ;
private JPanel photo;
jFrame.add(photo);
photo = new JPanelWithBg("bg.bmp");//
JPanelWhitBg类:JPanelWithBg extends JPanel;
JPanelWhitBg类重写:paintComponent(Graphics g);
photo = new JPanelWithBg("photo.bmp")//不起作用,调试很久发现,没有进到重写方法。
请问如何才能重写该方法?(repaint(),setVisiable()等都没有作用)