Hi
Claire,
By
looking at the Java documentation of JRootPane, you can use the method
setGlassPane where you can pass in a component you would like to act as the
glasspane.
If you
look at the class Component, you can see that a Container is also a Component,
so you could do this: rootPane.setGlassPane( new JPanel() );
and
then when you call getGlassPane, you can cast it to the JPanel: JPanel
glassPanel = (JPanel) rootPane.getGlassPane(); and then you can add you're
labels etc.
Hope
this helps,
Harm
-----Original Message-----
From: Claire Wall [mailto:[EMAIL PROTECTED]
Sent: woensdag 12 maart 2003 22:38
To: [EMAIL PROTECTED]
Subject: Re: AW: question on JSVGCanvas>From: "Lolling, Jan" <[EMAIL PROTECTED]> >Reply-To: "Batik Users" <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >Subject: AW: question on JSVGCanvas >Date: Tue, 11 Mar 2003 18:25:18 +0100 > >A possible architecture could be: >Use a JRootPane and add JSVGCanvas to the contentPane >Add your labels to the glassPane und make shure that your glassPane is not opaque. > >Be aware that JSVGCanvas resize his dimension if you load an SVG image zo fit the image ins the whole size. You have to adapt your svg code to create the correct image dimension. > >Jan > > >-----Ursprungliche Nachricht----- >Von: Claire WALL [mailto:[EMAIL PROTECTED] >Gesendet: Dienstag, 11. Marz 2003 18:15 >An: [EMAIL PROTECTED] >Betreff: question on JSVGCanvas > > >Hi, > >I want to have a JPanel with an SVG image as the background. >The JPanel will contain JLabels. How would I do this? > >Is it possible to add JLabels onto an JSVGCanvas? Or is there a >way to set an SVG image as a background with JLabels on top? > > >Claire > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >how do we add JLabels to the glassPane?
As I understand it, the JRootPane object contains a component glassPane. However the glassPane does not allow me to directly add a java component to itself. The only add method it has takes a PopupMenu object as its parameter and this is no good.
I know from your reply that it is possible to add JLabels (or any component for that matter) to the glassPane but as I have never used JRootPane before can't seem to see how to do this.
Any help would be good.
Cheers
Claire
Send instant messages for free with MSN Messenger. Click here to download it now! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
