[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: Resizing of text box while modifying text

public static void main(String[] args) {
    Display display = new Display();
    final Shell shell = new Shell(display);
    shell.setBounds(10,10,200,200);
    shell.setLayout(new GridLayout());
    final Text text = new Text(shell, SWT.WRAP | SWT.MULTI | SWT.BORDER);
    text.setLayoutData(new GridData(100, SWT.DEFAULT));
    text.addListener(SWT.Modify, new Listener() {
        public void handleEvent(Event event) {
            shell.layout();
        }
    });
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) display.sleep();
    }
    display.dispose();
}

Grant


"Sandeep Goel" <sandeep.goel@xxxxxxxxx> wrote in message
news:18323556.20831212389843770.JavaMail.root@xxxxxxxxxxxxxxxx
> Hi,
> I would like to resize (increase height)the multiline text box while
modifying the text so that whole text can be visible at the same time. How
it can be implemented?
> Can any body help me??
> following is code which I am using.
>
> Text t = new Text(shell,SWT.WRAP|SWT.MULTI|SWT.BORDER);
> t.setSize(200, 100);
>
> Regards,
> Sandeep Goel...