Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #2932

Re: Setting z-index in Sw

From "Mohammad Javad Dousti" <mohammad.javad.dousti@THRWHITE.remove-dii-this>
Subject Re: Setting z-index in Sw
Message-ID <e77478f3-abc6-4b99-b895-ca4dcebc3e45@d21g2000prf.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
References <7d650bee364bb@uwe>
Date 2011-04-27 15:41 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
On Dec 29, 7:51 am, "Andrew Thompson" <u32984@uwe> wrote:
> Mohammad Javad Dousti wrote:
>
> ..
>
> >1-I'm using absolute layout ..
>
> Why? *
>
> > ..in Java.
>
> Using absolute layouts is a bad idea in an X-plat,
> X-plaf, multi-VM language.
>
> >..I want to set the z-index of my
> >component after adding them.
>
> * What is this GUI that requires absolutely positioned,
> overlapping components?  Some types of GUIs might be
> better suited to a CardLayout that shows any one GUI
> element (usually a panel with many other panels and
> widgets inside it) a JTabbedPane or a JDesktopPane.
>
> >..How can I do so?
>
> Why do you want to do so?
>
> >2-How can I get the X and Y of an added component in absolut layout?
>
> One way would be to remember where you absolutely
> placed it in the first place (I would guess).  But also,
> you might try these methods listed in the JavaDocs
> java.awt.Component.getLocation(java.awt.Point)
> (as well as getX(), and getY() ).
>
> --
> Andrew Thompsonhttp://www.physci.org/
>
> Message posted viahttp://www.javakb.com

Because no other layout can do my work. I want to design a board game:
put the places as JButton and the player as another JButton and put it
on the places. But the arrangement of places is very specific! (Take a
look at http://en.wikipedia.org/wiki/Monopoly_(game))
As I said, the component doesn't know its X and Y (So we can't use
getX and getY)

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Setting z-index in Swing "Mohammad Javad Dousti" <mohammad.javad.dousti@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000
  Re: Setting z-index in Sw "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000
    Re: Setting z-index in Sw "Mohammad Javad Dousti" <mohammad.javad.dousti@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000
      Re: Setting z-index in Sw "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000
        Re: Setting z-index in Sw "Chase Preuninger" <chase.preuninger@THRWHITE.remove-dii-this> - 2011-04-27 15:42 +0000

csiph-web