English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

im developing a messenger that replicates YAHOO DOODLE environment, but the problem is that when some window ovelaps on the window that i use for drawing, and when i click the drawing window to get it on the top of other windows, the overlapped part of the drawing window is being displayed PLAIN ! So my question is how can i get back the content(drawing content) in the overlapped part. I'm almost through my project, got stuck at this, some opnoe please help me out !

2007-03-07 17:28:35 · 1 answers · asked by chintu_victor 1 in Computers & Internet Programming & Design

1 answers

This sounds like a repaint problem. For some reason, the canvas you are painting on is not repainting when the rest of the window gets "repaired". Add a WindowListener that implements (or subclass WindowAdapter and override) the windowActivated(WindowEvent we) method. In the body of the method, call repaint() on your drawing component (specifically, not just on the enclosing window). So, in other words, if you are using a subclass of JPanel for the drawing area, and it is inside of a JFrame, call repaint() on the JPanel object reference. If this doesn't work, take a close look at the code you added to do your drawing work. Something is overriding the "normal" repaint logic.

2007-03-09 02:30:47 · answer #1 · answered by vincentgl 5 · 0 0

fedest.com, questions and answers