tutorials.de Buch-Aktion 05/2012
ERLEDIGT
NEIN
ANTWORTEN
1
ZUGRIFFE
685
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    Dragowob Dragowob ist offline Mitglied
    Registriert seit
    Apr 2007
    Beiträge
    16
    Hi
    Kann mir jemand verraten wie ich mit SWT eine mehrzeilige Textbox bzw. Eingabefeld hinbekomme?
     

  2. #2
    Registriert seit
    Jun 2002
    Ort
    Saarbrücken (Saarland)
    Beiträge
    9.886
    Blog-Einträge
    29
    Hallo,

    schau mal hier:
    Code java:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    
    /**
     * 
     */
    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
     
    Java rocks!
    How to become a good Java Programmer?
    Does IT in Java and .Net
    The only valid measurement of code quality: WTFs / minute
    Blog
    Xing
    Twitter

Ähnliche Themen

  1. Mehrzeilige Button-Beschriftung
    Von Maus im Forum Swing, Java2D/3D, SWT, JFace
    Antworten: 4
    Letzter Beitrag: 23.08.10, 22:14
  2. Mehrzeilige Listbox
    Von notebook20000 im Forum CSS
    Antworten: 3
    Letzter Beitrag: 29.06.07, 15:45
  3. Mehrzeilige Tabellenzeilen mit SWT
    Von snappy42 im Forum Swing, Java2D/3D, SWT, JFace
    Antworten: 0
    Letzter Beitrag: 14.02.07, 12:44
  4. PropertyGrid mehrzeilige Textbox
    Von liquidbeats im Forum .NET Windows Forms
    Antworten: 4
    Letzter Beitrag: 05.04.06, 14:13
  5. Mehrzeilige msgBox
    Von curi im Forum Visual Basic 6.0
    Antworten: 1
    Letzter Beitrag: 03.03.05, 13:50