Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] Noob question

Is this really a question for this newsgroup?

 

Philipp Hübner
Softwareentwickler

Teraport GmbH
Aschauer Straße 32
D-81549 München

Tel.:   +49 (0)89 651086-730 
Fax:    +49 (0)89 651086-701 

philipp.huebner@xxxxxxxxxxx
Web: http://www.teraport.de/

*************************************************
Sitz der Gesellschaft: Leonberg
Registergericht Stuttgart HRB 253381
Geschäftsführer: Michael Grünschloß,
Stefan Ahrens, Thomas Fichtner, Hermann Gaigl

 

From: platform-swt-dev-bounces@xxxxxxxxxxx [mailto:platform-swt-dev-bounces@xxxxxxxxxxx] On Behalf Of Vinh Hoang
Sent: Tuesday, March 03, 2009 3:50 PM
To: Eclipse Platform SWT component developers list.
Subject: Re: [platform-swt-dev] Noob question

 

what do you want to show, it could change the way to do the change.  But the most generic way to do this would be to put the thing you want to replace in a double container, ie composite or composite with only one thing in it.  That way you can dispose the thing you want to replace, and create the new thing in that composite.  Or you can use stacklayout, which creates all the screens you want and allows you to move the screen you want to be seen on top to be seen.


On Tue, Mar 3, 2009 at 9:03 AM, Tilds <tilds15@xxxxxxxxxxx> wrote:


Hi guys im brand new to SWT and i have what is proberly a noob question for
you.

Im trying to make an application that, to start with, only shows a couple of
buttons.
When the user presses one of these buttons, the program should then show
something completely different in the window.
My question is:
What is the easiest way to do this? Do i close the current shell and make a
new one?

Here is what i have so far:
public class Prototype {

       public static void main(String [] args){
               Display display = new Display();
               Shell shell = new Shell(display);

               shell.setSize(800,600);

               GridLayout gridLayout = new GridLayout(2,true);

               shell.setLayout(gridLayout);

               Button nySag = new Button(shell,SWT.PUSH);
               nySag.setSize(100, 60);
               nySag.setText("Ny Sag");
               nySag.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, true, 1,
1));
               nySag.addSelectionListener(new SelectionAdapter() {
                       public void widgetSelected(SelectionEvent e) {
                               // ???????????
                       }
               });


               Button liste = new Button(shell,SWT.PUSH);
               liste.setSize(100, 60);
               liste.setText("Liste over all sagkyndige");
               liste.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true, 1, 1));


               shell.open();
               while(!shell.isDisposed()){
                       if(!display.readAndDispatch())
                               display.sleep();
                       }
               display.dispose();
       }
}

Please let me know if you need anymore info.

Hope you can point me in the right dirrection.

Regards
Tilds
--
View this message in context: http://www.nabble.com/Noob-question-tp22309189p22309189.html
Sent from the Eclipse Platform - swt mailing list archive at Nabble.com.

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev

 


Back to the top