Hi,
The areas we have needed to disable lightweight popups have been for
menus, tool tips, and combo boxes. The following details how to force
Heavy/Medium weight popups for these components:
To disable lightweight popups for a combobox do:
combobox.setLightWeightPopupEnabled(false);
for each combobox which may have a popup that overlaps a heavyweight.
To disable lightweight popups for tool tips do:
ToolTipManager ttm = ToolTipManager.sharedInstance();
ttm.setLightWeightPopupEnabled(false);
(Note that the javadoc says this method is deprecated but its documented
replacement does not exist so I can only assume the javadoc is in
error).
And to disable lightweight popups for all popup menus:
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
This call must occur before the relevant menus are created as it has no
effect on existing menus.
Note that there is a bug with cascading medium weight popups which
should be fixed in the next release. See
http://developer.java.sun.com/developer/bugParade/bugs/4188832.html for
details.
Now if only there was some way of getting multiple JInternalFrames to
coexist happily with heavyweight components without strange rendering
artifacts I would be estatic. The other small issue we have is dragging
the JSplitPane separator over a heavyweight but it is not as annoying as
the JinternalFrame problem.
Tim.
Tim Needham wrote:
>
> On Tue, 2 Mar 1999, Hock, Gregg wrote:
>
> > Hi again everyone,
> > I tried the archived solutions to this problem but without any luck.
> > Does anyone have a solution for using JMenuBar, Jmenu and JMenuItem(s) in
> > Java3D (app or applet)?
> > My problem is with getting the JMenuItems to appear. Is the Canvas3D the
> > culprit or Java3D in general?
>
> Yup, I had this problem - why oh why don't they give us a light weight
> Canvas3D? The problem is that when you mix lightweight and heavyweight
> components, the heavyweights seem to exhert themselves to the top of the
> drawing order. Anyway. I solved it as follows, you need to disable the
> lightweight popups on each JMenu. So your menu creation code looks like
> this:
>
> JMenuItem mi = new JMenuItem();
>
> JMenu file = (JMenu) menubar.add(new JMenu("File"));
> mi = (JMenuItem)file.add(new JMenuItem("Open"));
> mi = (JMenuItem)file.add(new JMenuItem("Save")):
> file.getPopupMenu().setDefaultLightWeightPopupEnabled(false);
>
> Now, what I want to know is can anyone work out how to grab the popup from
> the tooltip of a JButton so the same can be done?
>
> Tim.
>
> ,----------------------------------------------------------------------.
> | Tim Needham. |
> | OU Computer Society President. |\ ___,,--,_ __ |
> | [EMAIL PROTECTED] /,`--'' \`,,__,',-'|
> | http://ox.compsoc.net/~timothy |,4 ) )_ ) /~-----' |
> `------------------------------------------'---^~(_/-_)--(_/_)---------'
> Q: What do you get if you cross a horse with a mountain climber!
> A: You can't. A mountain climber is a scalar.
>
> =====================================================================
> To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
> Java 3D Home Page: http://java.sun.com/products/java-media/3D/
--
Tim Stevenson
Surpac Software International
16 Dollery Drive, Kingston, Tasmania, Australia 7050
Phone/Fax: +61 3 62294610
Home Phone: +61 3 62298866
Email: [EMAIL PROTECTED]
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/