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!