JideSplitButton not working on JidePopup using Java 7

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.

JideSplitButton not working on JidePopup using Java 7

Postby naanab » Mon Jan 06, 2014 7:19 am

Dear Sir, Madam,

In our transition to Java 7 we came across some functionality that doesn't seem to work as before. We are using a JideSplitButton shown on a JidePopup. Using Java 7 the menu items don't work anymore. Using Java 6 everything works as expected.

When running the following demo, using jdk1.7.0_45 on OSX, selecting a menu item does nothing. We are using Jide 3.5.12.

Code: Select all
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JMenuItem;

import com.jidesoft.popup.JidePopup;
import com.jidesoft.swing.JideSplitButton;

public class JidePopupDemo extends JidePopup {

    public JidePopupDemo() {
        super();

        JButton button = new JButton("Close");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                hidePopup();
            }
        });
        button.setToolTipText("Button");

        final JideSplitButton jsb = new JideSplitButton();
        jsb.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(final ActionEvent e) {
                System.out.println("Default option");
            }
        });
        jsb.setText("Select option");

        final JMenuItem item1 = new JMenuItem("Item1");
        item1.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(final ActionEvent e) {
                jsb.setText("Option 1");
                System.out.println("1");
            }
        });
        jsb.add(item1);
        final JMenuItem item2 = new JMenuItem("Item2");
        item2.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(final ActionEvent e) {
                jsb.setText("Option 2");
                System.out.println("2");
            }
        });
        jsb.add(item2);
        jsb.setPreferredSize(new Dimension(100, 20));

        getContentPane().add(jsb, BorderLayout.CENTER);
        getContentPane().add(button, BorderLayout.SOUTH);

        packPopup();
    }

    public static void main(String[] args) {
        JidePopupDemo jidePopupDemo = new JidePopupDemo();
        jidePopupDemo.showPopup();
    }

}


Is there some additional configuration needed when using Java 7? I haven't been able to test the behaviour on a Windows platform.

Kind regards,
Alexander
naanab
 
Posts: 6
Joined: Tue Jan 05, 2010 3:53 am

Re: JideSplitButton not working on JidePopup using Java 7

Postby JIDE Support » Mon Jan 06, 2014 9:21 am

We are aware of the issue and fixed it (but not yet released). If you get a chance, could you build a jar from JIDE Common Layer at github and use the generated jar (just put generated jide-oss-xxx.jar before jide-common.jar in your classpath) to verify the fix?
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JideSplitButton not working on JidePopup using Java 7

Postby naanab » Tue Jan 07, 2014 12:55 am

I've just cloned the jide-oss project. I noticed the pom version is still 3.5.12. Couldn't find a snapshot so i packaged it anyway. Using the new jar i get the same results. JideSplitButton not working on a JidePopup. I removed the original jide-common jar from the classpath entirely to make sure the new jar is used.
naanab
 
Posts: 6
Joined: Tue Jan 05, 2010 3:53 am

Re: JideSplitButton not working on JidePopup using Java 7

Postby JIDE Support » Tue Jan 07, 2014 12:54 pm

The POM version will not be updated until we have a new release.

If that's the case, it is probably a bug on Mac JDK. Please refer to another thread here. It has a test case that you can run. JideSplitButton is a JMenu which uses JPopupMenu so it is very likely to inherit the bug.

http://www.jidesoft.com/forum/viewtopic.php?f=10&t=14950&p=73385
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 3 guests

cron