Popup menu

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Ted Hill

Popup menu

Post by Ted Hill » Fri Aug 23, 2002 7:42 pm

Hello,

I would like to put up my own popup menu over the ChartPanel. (This would let the user pick one of several charts to display in the chart area.)

Currently when I right click on a ChartPanel, a JFreeChart popup is activated.

Can someone advise me on how to put up my own menu instead of the JFreeChart's popup.

Thank you,

Ted Hill

David Gilbert

Re: Popup menu

Post by David Gilbert » Mon Aug 26, 2002 8:36 am

This is not something that is easy to do without modifying the ChartPanel source code (which, of course, you can do if you want to). I will add a task to my to-do list to make this possible without modifying the JFreeChart code.

Regards,

DG.

Ted Hill

Re: Popup menu

Post by Ted Hill » Tue Aug 27, 2002 4:52 pm

David,

What I did was to extend ChartPanel and add a method

public setPopupMenu(JPopupMenu myPopup)
{
popup = myPopup;
}

to expose the protected popup member. This works nicely,

Thanks for your help,

Ted Hill

David Gilbert

Re: Popup menu

Post by David Gilbert » Tue Aug 27, 2002 5:36 pm

Thanks for the feedback Ted, I'll make a similar change to ChartPanel now for inclusion in 0.9.3.

Regards,

DG.

Ted Hill

Re: Popup menu

Post by Ted Hill » Wed Mar 12, 2003 6:44 pm

Hi David,

I've been away from JFreeChart for a while.

In ChartPanel, popup used to be protected, so my solution to installing my own popup menu shown earlier in this thread worked.

Now popup is private.

Is there another way to install my own popup menu on the ChartPanel now?

Thanks,

Ted Hill

Locked