Mehrzeilige Textbox mit SWT

Hallo,

schau mal hier:
Java:
/**
 * 
 */
package de.tutorials;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

/**
 * @author Tom
 *
 */
public class SWTMultilineTextFieldExample {

  /**
   * @param args
   */
  public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setText("SWTMultilineTextFieldExample");
    shell.setLayout(new FillLayout());
    
    Text text = new Text(shell,SWT.MULTI);
    text.setText("ABC\nDEF");
    
    shell.pack();
    shell.open();
    
    while(!shell.isDisposed()){
      if(!display.readAndDispatch()){
        display.sleep();
      }
    }
  }
}

Gruß Tom
 
Zurück