Grace,

Use this to get the screen size:
Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();

Then "screenDim.width" should give you the width and something like
"yourdialog.setLocation(screenDim.width/2,0)" would position your gui
dialog (halfway across the screen).

- John Wright
Starfire Research

Grace S wrote:
>
> Hi,
> Thanks for the suggestion, But could you please give me an example of the
> code that would be used to do this, or could you tell me where I could find
> sample code that does this.  As I am unsure of how to do this.
>
> thanks
> Grace
>
> >From: John Wright <[EMAIL PROTECTED]>
> >Reply-To: Discussion list for Java 3D API <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: [JAVA3D] swing popup window
> >Date: Sun, 31 Mar 2002 15:31:10 -0600
> >
> >Grace,
> >
> >Query for the resolution of the screen, then subtract the width of your
> >GUI dialog and use that as your x location to draw it.
> >
> >- John Wright
> >Starfire Research
> >
> >Grace S wrote:
> > >
> > > Hi,
> > > The following code is executed when a user  presses the �F1� key.
> > >
> > >         public void mapPopup() {
> > >
> > >                         Toolbar3 gui = new Toolbar3();
> > >
> > >                 }
> > >
> > > It calls �Toolbar3()� which is a swing GUI.  When the GUI is loaded it
> >gets
> > > displayed by default in the top left hand corner, I was wondering how &
> > > where I would specify for the GUI to be displayed in the top right hand
> > > corner.
> > >
> > > Thanks
> > > Grace
> > >
> > > _________________________________________________________________
> > > MSN Photos is the easiest way to share and print your photos:
> > > http://photos.msn.com/support/worldwide.aspx
> > >
> > >
> >===========================================================================
> > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> >body
> > > of the message "signoff JAVA3D-INTEREST".  For general help, send email
> >to
> > > [EMAIL PROTECTED] and include in the body of the message "help".
> >
> >===========================================================================
> >To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> >of the message "signoff JAVA3D-INTEREST".  For general help, send email to
> >[EMAIL PROTECTED] and include in the body of the message "help".
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA3D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to