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


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

Re: Setting z-index in Sw

From "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Subject Re: Setting z-index in Sw
Message-ID <7d650bee364bb@uwe> (permalink)
Newsgroups comp.lang.java.gui
References <6dd368ff-e469-4792-ae64-05bdc934d990@a35g2000prf.googlegroups.com>
Date 2011-04-27 15:41 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
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 Thompson
http://www.physci.org/

Message posted via http://www.javakb.com

---
 * 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