File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes No methods executing on component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "No methods executing on component" Watch "No methods executing on component" New topic
Author

No methods executing on component

Derek Boring
Ranch Hand

Joined: Aug 15, 2006
Posts: 65
I have a class I created called picPanel that extends JPanel. Basically this class has a bufferedImage variable and in the paint event, it draws this image scaled down proportionally to fit inside the visible area of panel. The class contains only two methods: the constructor and paint. I added a mouseListener to the panel from it's container's class to open a window containing only the picPanel and functions for zoom. The problem I'm having is that once I added the mouseListener and changed the cursor to the hand, it stopped executing the panel's events, even the constructor. I tested it by putting System.out.println("constructor/paint") in the events. It even refuses to paint when I call repaint() from the container class. Eclipse keeps telling me there are errors in this file (the panel and it's container are in the same .java file) but it doens't show me where, the program runs just fine and there is no stack trace printed at any time. I've analyzed the code and tried commenting out and adding stuff dozens of times and I can't seem to get any different results.

Does anyone have an idea of what could be wrong?


Life is 10% what happens and 90% how you react to it.
Attitude is everything.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Are you sure Eclipse is telling you there are errors? Eclipse won't usually compile a file with errors in.
There is the facility to view errors by using the tabs at the bottom of Eclipse; you need to look for view->problems.
If you can't find it out quickly please post some code so people can see what is going wrong.
Derek Boring
Ranch Hand

Joined: Aug 15, 2006
Posts: 65
Fixed it. Thank you.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Originally posted by Derek Boring:
Fixed it. Thank you.
You're welcome.

Please tell us brifely how you fixed it.
Derek Boring
Ranch Hand

Joined: Aug 15, 2006
Posts: 65
Haha! it's actually a little embarrassing. I had two classes named PicPane wihtout realizing it and then what Campbell said made me realize it.

Thanks again. You guys rock!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No methods executing on component