Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

MouseEvent

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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......

thanks,
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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....
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic