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


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

Re: Problem with SWT - "B

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Subject Re: Problem with SWT - "B
Message-ID <714eddfbdec59@uwe> (permalink)
X-Comment-To comp.lang.java.gui
Newsgroups comp.lang.java.gui
In-Reply-To <1177594352.493638.96580@r35g2000prh.googlegroups.com>
References <1177594352.493638.96580@r35g2000prh.googlegroups.com>
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 40
Date Wed, 27 Apr 2011 15:33:57 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303918437 96.60.20.240 (Wed, 27 Apr 2011 10:33:57 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:33:57 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.gui:1548

Show key headers only | View raw


  To: comp.lang.java.gui
lukasz.konkel@gmail.com wrote:
..
>I have question, I generate buttons, using the code bolow
>
>Button but = null;
>but = new Button (this,SWT.PUSH);
>but.setText("Test="+a);
>but.setBounds(new Rectangle(0, 0, 16, 16));
>but.setLocation(10, 10);
>but.setSize(100, 20);

Not that I know much about SWT, but this snippet 
tells me very little..

>but when I move this element over another example label, this button
>is under the label, how to "bring to front" this button.

A quick Google for 'swt layout' suggests that SWT
uses the same basic mechanism as Swing and the
AWT to layout components, and that is 'layouts'.

I am guessing (for want of more code) that the code
is not using a layout to calculate the appropriate size
and position of components, and that is the fundamental
source of the problem.

The solution it to use a layout.

-- 
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-gui/200704/1

---
 * 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 | Find similar | Unroll thread


Thread

Problem with SWT - "Bring "lukasz.konkel" <lukasz.konkel@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
  Re: Problem with SWT - "B "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000

csiph-web