Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Java Native Interfaces with SWT/JFace Discuss the book Professional Java Native Interfaces with SWT/JFace, by Jackwind Li Guojie, ISBN: 0-470-09459-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Java Native Interfaces with SWT/JFace section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 12th, 2006, 03:20 AM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default no scroll bar on sashform

hi,
   i have SashForm and am adding controls to it dynamically...But once the size of the controlls is more than that of sash no vertical scroll is occuring. pls help.........

here is the code

package swt;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Shell;

public class SashExample {

public static void main (String [] args) {
    Display display = new Display ();
    Shell shell = new Shell (display);
    /*final Sash sash = new Sash (shell, SWT.BORDER | SWT.VERTICAL);
    sash.setBounds (10, 10, 15, 60);
    sash.addListener (SWT.Selection, new Listener () {

        public void handleEvent (Event e) {
            System.out.println("Selected. ");
            sash.setBounds (e.x, e.y, e.width, e.height);
        }
    });*/
    Group profileGrp,sessions,interval,duration,urls,objects ,datachannel,summary;
    shell.setLayout(new FillLayout());
    SashForm composite = new SashForm( shell, SWT.HORIZONTAL );

    final Composite composite_1 = new Composite(composite, SWT.NONE);
    composite_1.setLayout(new GridLayout());
    GridLayout gridLayout = new GridLayout(2,true);


    summary = new Group(composite_1, SWT.SHADOW_IN);
    summary.setText("Output file for summary");
    summary.setLayout(new GridLayout(2,true));
    final GridData gridData_2 = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gridData_2.heightHint = 58;
    summary.setLayoutData(gridData_2);
    final Label summaryLabel = new Label(summary, SWT.NONE);
    summaryLabel.setText("file name");
    Text summText = new Text(summary, SWT.SINGLE | SWT.RIGHT | SWT.BORDER);
    summText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    datachannel = new Group(composite_1, SWT.SHADOW_IN);
    datachannel.setText("Output file for data channel");
    datachannel.setLayout(new GridLayout(2,true));
    datachannel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    final Label dChannel = new Label(datachannel, SWT.NONE);
    dChannel.setText("file name");
    Text dText = new Text(datachannel, SWT.SINGLE | SWT.RIGHT | SWT.BORDER);
    dText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    objects = new Group(composite_1, SWT.SHADOW_IN);
    objects.setText("Objects");
    objects.setLayout(new GridLayout(2,true));
    objects.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    final Label inclObjLabel = new Label(objects, SWT.NONE);
    inclObjLabel.setLayoutData(new GridData());
    inclObjLabel.setText("include");

    Text incObjText = new Text(objects, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER);
    final GridData objGgridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
    objGgridData.heightHint = 40;
    incObjText.setLayoutData(objGgridData);

    final Label exclObjLabel = new Label(objects, SWT.NONE);
    exclObjLabel.setText("exclude");

    Text exclText = new Text(objects, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER);
    final GridData objGridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
    objGridData.heightHint = 40;
    exclText.setLayoutData(objGridData);

    urls = new Group(composite_1, SWT.SHADOW_IN);
    urls.setText("URLs");
    urls.setLayout(new GridLayout(2,true));
    urls.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    final Label includeLabel = new Label(urls, SWT.NONE);
    includeLabel.setLayoutData(new GridData());
    includeLabel.setText("include");

    Text incText = new Text(urls, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER);
    final GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gridData.heightHint = 39;
    gridData.minimumHeight = 10;
    incText.setLayoutData(gridData);

    final Label excludeLabel = new Label(urls, SWT.NONE);
    excludeLabel.setText("exclude");

    Text excText = new Text(urls, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER);
    final GridData gridData_1 = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gridData_1.heightHint = 44;
    excText.setLayoutData(gridData_1);



    duration = new Group(composite_1, SWT.SHADOW_IN);
    duration.setText("Duration of the test");
    duration.setLayout(new GridLayout(2,true));
    duration.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    Label dur = new Label(duration,SWT.LEFT);
    dur.setText("duration");
    Text durv = new Text(duration,SWT.SINGLE|SWT.RIGHT|SWT.BORDER);
    durv.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    durv.setText("");

    interval = new Group(composite_1, SWT.SHADOW_IN);
    interval.setText("Interval between sessions in millis:");
    interval.setLayout(new GridLayout(2,true));
    interval.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    Label mean = new Label(interval,SWT.LEFT);
    mean.setText("mean");
    Text mv = new Text(interval,SWT.SINGLE|SWT.RIGHT|SWT.BORDER);
    mv.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    mv.setText("");
    Label dev = new Label(interval,SWT.LEFT);
    dev.setText("deviation");
    Text dv = new Text(interval,SWT.SINGLE|SWT.RIGHT|SWT.BORDER);
    dv.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    dv.setText("");

    sessions = new Group(composite_1, SWT.SHADOW_IN);
    sessions.setText("Max number of concurrent sessions:");
    sessions.setLayout(new GridLayout(2,true));
    sessions.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    Label s =new Label(sessions,SWT.LEFT);
    s.setText("sessions:");
    Text v = new Text(sessions,SWT.SINGLE|SWT.RIGHT|SWT.BORDER);
    v.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    v.setText("");

    profileGrp = new Group(composite_1, SWT.SHADOW_IN);
    profileGrp.setLayout(gridLayout);

    profileGrp.setText("User Profiles:");
        //profileGrp.setBackground(new Color(composite.getDisplay(),255,255,255));

        //GridData gridData = new GridData(SWT.BEGINNING,SWT.CENTER,true,false);
        //gridData.horizontalSpan = 2;

    profileGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Label pname = new Label(profileGrp,SWT.LEFT);
    pname.setText("name");
    Label pweight = new Label(profileGrp,SWT.RIGHT);
    pweight.setText("weight in %");
    Label p1 = new Label(profileGrp,SWT.LEFT);
    p1.setText("Profile 1");
    Label w1 = new Label(profileGrp,SWT.RIGHT);
    w1.setText("50");
    Label p2 = new Label(profileGrp,SWT.LEFT);
    p2.setText("Profile 2");
    Label w2 = new Label(profileGrp,SWT.RIGHT);
    w2.setText("50");
    composite.setWeights(new int[] { 1 });

       Button b1 = new Button( composite, SWT.PUSH );
       b1.setText( "Button One" );

        composite.setLayout(new GridLayout(1,true));



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


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scroll bar problem - simple jiggsroger C# 2005 3 April 11th, 2008 02:42 AM
How to control scroll bar BurhanKhan Javascript 3 August 26th, 2004 02:31 PM
How can I make two scroll bar to be the same one? Daniel_hn Visual C++ 1 September 16th, 2003 09:28 AM
css and scroll bar markhardiman HTML Code Clinic 3 July 18th, 2003 04:55 AM
Scroll Bar cooldude87801 BOOK: Beginning Java 2 0 June 18th, 2003 11:59 AM



All times are GMT -4. The time now is 01:49 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.