File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes How come this isn't working anymore? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How come this isn Watch "How come this isn New topic

How come this isn't working anymore?

Steven YaegerII
Ranch Hand

Joined: May 31, 2000
Posts: 182
The following Chart class defines a chart and also uses the Graphic2D class to draw itself. It works fine when in a frame without any JMenus or JMenuItems. With menu stuff added, when I click on "File" & then click to display the single sub-menu, it freezes on the screen and I get a bunch of runtime errors:
at Chart.paint(, Compiled Code)
at javax.swing.JComponent.paintChildren(
at ... JComponent.paint(
at ... JLayeredPane.paint(
... that's the jist of them. How come it's not working now ?
Also, any suggestions on shorter Chart implementations are good.

please use the [ code ] opening and closing tags (without the spaces) when posting source code.
Thanks for your cooperation.
- satya

[This message has been edited by Madhav Lakkapragada (edited March 30, 2001).]
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
I don't see any JMenu's? You have to show us the BROKEN stuff, not just the stuff that works.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Steven YaegerII
Ranch Hand

Joined: May 31, 2000
Posts: 182
Yes, I should have included the other code also. The problem is with the above public class Chart extends JComponent and the two classes below:

I agree. Here's the link:
subject: How come this isn't working anymore?
It's not a secret anymore!