problems with paintComponent - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

problems with paintComponent

yanghui1023yanghui1023 Posts: 24Member
hello,

I want to draw many shapes in my application.I used JFrame,JMenubar,JMenu and JToolbar.I first drew many shapes on a JPanel object with paint method. But every time the application initiates, The menubar,menu,toolbar and buttons on the toolbar buttons appears twice.Then,I used paintComponent method instead of paint, and it successfully displayed the shapes on the panel.and the menubars,menus and toobar worked well.
But,when and dialog(JOptionPane.showConfirmDialog) appears and then disappears,the locale where the dialog located shows a shadow area.
Is there a method to refresh the panel?Or are there any other solutions to this problem?
Thanks in advance!
Sign In or Register to comment.