Insubstantial / insubstantial

Swing look-and-feel library and assorted widgets
193 stars 57 forks source link

ComboBox PopupMenuListeners broken for Java 1.6u25 and newer #36

Closed cherry79 closed 12 years ago

cherry79 commented 12 years ago

Hi,

just stumbled upon a not fully functional popupmenulistener for JComboBoxes when using current JDK and Substance 6.2 (tried 6.3, bug is still there):

Problem is: PopupMenuListener don't receive popupMenuWillBecomeVisible from JComboBox

popupMenuWillBecomeInvisible is still executed as before.

It seems they have changed the place where the popupMenuWillBecomeVisible is called, see:

https://forums.oracle.com/forums/thread.jspa?threadID=2229101

shemnon commented 12 years ago

Can you check this against the 7.0 releases or newer? And is it still broken in Java 7?

Also, a code snippit to demonstrate this would be good as well. Does the snippet in the referenced sun bug reproduce the problem as you have it? http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4743225

cherry79 commented 12 years ago

Am 10.01.2012 20:18, schrieb Danno Ferrin:

Can you check this against the 7.0 releases or newer? And is it still broken in Java 7?

Still broken for substance7.0 and java 1.6_27/1.6_30/1.7_02.

I use x64-Versions, but that shouldn't make any difference.

Also, a code snippit to demonstrate this would be good as well. Does the snippet in the referenced sun bug reproduce the problem as you have it? http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4743225

I'm quite sure the snippet will show the bug, because it uses a PopupMenuListener.

But it's quite easy to reproduce: have a jcombobox anywhere, add a PopupMenuListener to the combobox, and try to do some stuff in the popupMenuWillBecomeVisible()-method of the PopupMenuListener, and see that nothing happens.

This is for SubstanceMistAqua-LaF, it's fine with java-standard-Metal-LaF.

I have not dug to deep into the cause (reworked my combobox so it doesn't rely on popupMenuWillBecomeVisible() to function properly), only found the thread i linked in the bug-report hinting to the cause of the problem.

Martin

kschaefe commented 12 years ago

This will always fail in Substance because SubstanceComboPopup overrides show, which is now the location that comboBox.firePopupWillBecomeVisible() is called from. I can't understand why it overrides BasicComboPopup.show in the first place, as it seems that the code (prior to 1.6.0_25) is identical in the subclass. I think if we just remove SubstanceComboPopup.show, this this will work in both <= 1.6.0_24 and >= 1.6.0_25.

This issue is rather critical for us. What would be the timeframe on it?

shemnon commented 12 years ago

Is it really just deleting the show? It seems to me it was just a copy pre 6u25, so it should work.

You can try the 7.2-SNAPSHOT at https://oss.sonatype.org/content/repositories/snapshots but I don't anticipating rolling another release until at least June.

cherry79 commented 12 years ago

Not that i'm in a hurry (i found a way to work around the problem, so it's just a convenience-thing for me and i can easily wait till june), but now you made me curious and i wanted to have a look at the 7.2-stuff. Could you please provide a bit more information on how to find it? I seem to be unable to find my way around at the sonatype.org-directory.

Martin

shemnon commented 12 years ago

It's the one with the most recent timestamp in the following directories:

https://oss.sonatype.org/content/repositories/snapshots/com/github/insubstantial/flamingo/7.2-SNAPSHOT/ https://oss.sonatype.org/content/repositories/snapshots/com/github/insubstantial/laf-plugin/7.2-SNAPSHOT/ https://oss.sonatype.org/content/repositories/snapshots/com/github/insubstantial/laf-widget/7.2-SNAPSHOT/ https://oss.sonatype.org/content/repositories/snapshots/com/github/insubstantial/substance/7.2-SNAPSHOT/ https://oss.sonatype.org/content/repositories/snapshots/com/github/insubstantial/substance-flamingo/7.2-SNAPSHOT/ https://oss.sonatype.org/content/repositories/snapshots/com/github/insubstantial/substance-swingx/7.2-SNAPSHOT/ https://oss.sonatype.org/content/repositories/snapshots/com/github/insubstantial/substance-trident/7.2-SNAPSHOT/

Specifically I think you want https://oss.sonatype.org/content/repositories/snapshots/com/github/insubstantial/substance/7.2-SNAPSHOT/substance-7.2-20120405.145917-3.jar

kschaefe commented 12 years ago

I finally got a chance to test this and my code relying on popupMenuWillBecomeVisible now works. Thanks.

xmedeko commented 11 years ago

Remove also unused methods SubstanceComboPopup.setListSelection() and SubstanceComboPopup.getPopupLocation().