Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / April 2007

Tip: Looking for answers? Try searching our database.

Problem with SWT - "Bring to front"

Thread view: 
lukasz.konkel@gmail.com - 26 Apr 2007 14:32 GMT
Hello

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);

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

Lukasz
Andrew Thompson - 27 Apr 2007 03:27 GMT
...
>I have question, I generate buttons, using the code bolow
>
[quoted text clipped - 4 lines]
>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.

Signature

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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.