Re: Weird Problem in using MouseListener
From: Ian Shef (invalid_at_avoiding.spam)
Date: 02/19/04
- Next message: Anton Spaans: "Re: parsing string data through castor"
- Previous message: madhununna: "Re: parsing string data through castor"
- In reply to: Minti: "Weird Problem in using MouseListener"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 19 Feb 2004 19:23:48 GMT
mintiSPAMBLOCK@yahoo.com (Minti) wrote in news:e87fc4b0.0402021802.7f5fcc26
@posting.google.com:
> Hi there all, I am having a weird problem in the following Applet
> code,
>
> <begin code>
<snip>
> <end code>
>
> The calls to System.out.println() are for debugging purposes only.
>
> The problem is that when the applet is running, whenever mouse is
> clicked the applet shows MouseRelasedMouseClicked, even though I set
> the msg to "" whenever paint is called, the line with
> System.out.println(msg) in mouseReleased() shows that somehow the call
> to repaint() just did not occur, Am I missing any point on how the
> paint method works.
>
>
> I belive it is possibly because of the paint queue, that might be
> maintained and from which only the most recent call to paint is
> executed.
>
Calls to repaint queue up a request for paint to happen.
The paint does not happen immediately, so your listeners cannot depend upon
paint to clear out msg. The paint will occur sometime in the future.
However, multiple requests in the paint queue can be collected together, so
there is not neceesarily a one-to-one correspondence between calls to
repaint and executions of paint.
It is time to come up with a new plan of how to arrange your program.
Good Luck!
-- Ian Shef 805/F6 * These are my personal opinions Raytheon Company * and not those of my employer. PO Box 11337 * Tucson, AZ 85734-1337 *
- Next message: Anton Spaans: "Re: parsing string data through castor"
- Previous message: madhununna: "Re: parsing string data through castor"
- In reply to: Minti: "Weird Problem in using MouseListener"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|