Xara
Xara

Reputation: 9098

Opening a new panel by just clicking a portion of the panel

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

Answers (1)

Andrew Thompson
Andrew Thompson

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

Related Questions