问题:UserViewer 是一个JFrame public UserViewer(){
super("Mockup");
setSize( 800, 600 );
Container ContentPane = getContentPane();
toolBar = buildToolBar();
gc = new GraphController(curveType, bgType);
panel1=new JPanel();
panel1.add(gc, BorderLayout.CENTER);
mainPane =  new JScrollPane(panel1, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
ContentPane.add(toolBar,BorderLayout.NORTH);
ContentPane.add(mainPane, BorderLayout.CENTER);
g = ContentPane.getGraphics();
setVisible(true);
}
其中的gc是自己扩展的一个Jcomponment, 有自己的paint方法,当运行完程序以后,如果界面上出现了被别的东西遮挡的情况,那么
gc的被挡住的那个部分就不见了, 只有重新拉动一下整个窗口,才能够把图像完整的显示出来请问我的问题如何解决??谢谢!!