File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes MouseEvent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "MouseEvent" Watch "MouseEvent" New topic


Fernando hiar

Joined: Jan 11, 2008
Posts: 29
I´m creating a program who is loaded in JPanel superior the images and when the user click in an imagem this image appear in Jpanel inferior...

there´s the code of Janela1(Window1)

there´s the code of the two JPanel superior and inferior who the classes is : PintarImagem and EventImagem...there´s the 2 classes:

PintarImagem(JPanel superior):

and EventImagem:

the issues is: when I call the Mouse event, the event call paintComponent of EventImagem class load the imagem of this method, but don´t paint the image in JPanle inferior, the question is Why? I debugged this code and I see, first the jvm call paintComponent of EventImagem and after the jvm call paintComponent of PintarImagem.... I don´t know what´s happening......

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Nothing wrong in posting code in a language
few here can interpret.

In doing so, it is critical that the code must
compile and/or run with java error messages that gives us a clue to the problem.

'cannot find class ...' as an error message
is just wasting everyone's time.
Fernando hiar

Joined: Jan 11, 2008
Posts: 29
There´s no error of compilation, but the image doesn´t appear in the event..... I thought there´s an error of logic or the language....I don´t know....
Darryl Burke

Joined: May 03, 2008
Posts: 5115

Fernando hiar wrote:There´s no error of compilation

Someone with 3690 posts doesn't make a silly statement. Can you compile the three classes you posted, in isolation?

Hint: you can't. Try it, discover why, then post code that people can actually help you with, preferably in the form of an SSCCE <--click the link.

luck, db
There are no new questions, but there may be new answers.
I agree. Here's the link:
subject: MouseEvent
jQuery in Action, 3rd edition