after finding the actual problem to my symptoms, I'm now completely lost.
I have a JMenuBar in a JApplet.
The menubar contains a menu, which has as submenu and a JTextfield "A".
The submenu has antoher JTextfield "B".
Running the applet in a browser with width and height set to 100%, both Textfields are editable.
Running the applet in a browser with width set to 100% and height set to "45" the textfield in the submenu ("B") is not editable.
The problem occurs with IE6 and JRE 1.6.0_12, with JRE 1.5.0_09 it doesn't.
I've never tried putting a JTextField in a menu -didn't know that was possible, and am not sure that it's even supposed to work- but the applet width and height parameters are in *pixels*, not *percentages*.
Well, I can put a JTextfield in a JPopupMenu and it works fine. Putting it in a JMenu in an applet that's large enough seems to be fine too. But this thing drives me crazy. Especially because it works if the Textfield is part of a top-level menu.
Any ideas? Please?
(And why can't I define my applet/object-tag with percentage-values? Is this not specified? It works with IE ...)
Joined: Mar 22, 2005
And why can't I define my applet/object-tag with percentage-values? Is this not specified? It works with IE ...
Umm, are you new to web development? :-) Just because something works in IE does NOT mean that it works anywhere else, nor does it mean that it conforms to any standard (which in this case is set by Sun, not Microsoft).
Joined: Sep 03, 2008
Well, I'm into Swing/Applet-Development for some years now, so not actually "new". And I didn't expect it to work on all platforms - but IE is standard in our company, so "%" saves me some scripting. That's why I asked if it was specified this way. Looking it up, I just found suggestions that you shouldn't use it - but no specification. (Which doesn't mean it doesn't exist - I just googled 10mins!)
Anyway ... pixel-sizes don't help - same effect. I'm aware the guys from sun didn't expect developers to put a JTextfield in a JMenu. I even found a posting on sun's Bug-DB (in a different context) where a supporter was totally surprised that people could have such an idea. But browsing swing-codes I can't see why it shouldn't work. Having a JTextfield in a simple JPopupMenu (without JMenu as parent) always works - no matter how big or small the applet is and whether the popup is inside or outside the applet- or browser-area. But that won't solve my problem since I need the JMenu.
Our company can't upgrade to JRE 1.6 unless I either solve this problem or write them a different user-interface (which they have to accept first).
Joined: Sep 03, 2008
For anyone who might have the same problem some day, I reported the bug to sun: