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


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

Re: component coordinate offsets

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.gui
Subject Re: component coordinate offsets
Date 2011-12-27 08:21 -0800
Organization Canadian Mind Products
Message-ID <v0sjf7tdtvehn7lt3fhm9vij8cd2vs8u6s@4ax.com> (permalink)
References <Layout-20111224151721@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 24 Dec 2011 14:28:34 GMT, ram@zedat.fu-berlin.de (Stefan Ram)
wrote, quoted or indirectly quoted someone who said :

>  The container (JPanel) decides at run time to draw his marks
>  ">" and "<" at the height 4. The containees (JComponent)
>  should then draw their »o« at the same height. But they
>  cannot simply use the height 4, because they have another
>  coordinate system. Can they get the offset of their
>  coordinate system relatively to the container's coordinate
>  system so as to convert the coordinate?

If you write your own layout manager you can put whatever fields in it
you want.  When Components are added, you save pointers to them so you
can dynamically compute their sizes.  You can could call any other
method while you were at it.

See http://mindprod.com/jgloss/layout.html

Writing a layout manager is much simpler than you might expect.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
If you can't remember the name of some method, 
consider changing it to something you can remember.
 

Back to comp.lang.java.gui | Previous | Next | Find similar


Thread

Re: component coordinate offsets Roedy Green <see_website@mindprod.com.invalid> - 2011-12-27 08:21 -0800

csiph-web