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


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

Re: Problem with SWT - "B

From "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Subject Re: Problem with SWT - "B
Message-ID <714eddfbdec59@uwe> (permalink)
Newsgroups comp.lang.java.gui
References <1177594352.493638.96580@r35g2000prh.googlegroups.com>
Date 2011-04-27 15:33 +0000
Organization TDS.net

Show all headers | 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