Scrolling the the popup sub menu

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Scrolling the the popup sub menu

Postby Skjalg » Tue Jun 15, 2010 6:02 am

Hi there, I was wondering how I could achieve the scrolling behavior in a popup sub menu.

See the attached code for what I mean;
Code: Select all
public static void main(String[] args) {
        final JFrame d = new JFrame();
        final JidePopupMenu ppm = new JidePopupMenu();
        for (int j = 1; j < 150; j++) {
            JMenu option = new JMenu("JMenu Option " + j);
            for (int i = 1; i < 150; i++) {
                option.add(new JMenuItem("JMenuItem Option " + i));
            }
            ppm.add(option);
        }


        d.addMouseListener(new MouseAdapter() {

            public void mouseClicked(MouseEvent e) {
                ppm.show(d, e.getX(), e.getY());
            }
        });
        d.setPreferredSize(new Dimension(200, 100));
        d.setVisible(true);
        d.pack();
    }

The list of JMenu Options scrolls perfectly fine, but their submenus does not.
I have tried adding a simple scroll to the popup menu (with all the menuitems) but each time I hover over that menu item the popup disappears....
Skjalg
 
Posts: 51
Joined: Tue May 12, 2009 6:45 am

Re: Scrolling the the popup sub menu

Postby JIDE Support » Tue Jun 15, 2010 9:14 am

It's not easy to override the submenu to have scrollable. Please check out if the code shared by klakotko http://www.jidesoft.com/forum/viewtopic.php?f=10&t=9654 could help your case.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Scrolling the the popup sub menu

Postby Skjalg » Wed Jun 16, 2010 12:38 am

Thanks a lot, I'm sorry I didn't find that before posting.

Is there any chance you guys can adapt his code and add this functionality as a Jide class?
Skjalg
 
Posts: 51
Joined: Tue May 12, 2009 6:45 am

Re: Scrolling the the popup sub menu

Postby JIDE Support » Wed Jun 16, 2010 11:37 am

I'm afraid not for now.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 62 guests