Reputation: 9098
I am using Net beans drag and drop GUI and in that i am displaying a chart in a jPanel and i want that when i click a portion of that chart then another panel opens up.I know we can write an event , when we click a whole panel(anywhere in panel) but i just want that when i click the small potion of that chart only then another panel opens up, how is this possible?
Upvotes: 1
Views: 78
Reputation: 168825
Attach a MouseListener
to the panel. Detect the events, take action. See How to Write a Mouse Listener for more details.
Upvotes: 5