SWT Style

Status
Nicht offen für weitere Antworten.
G

Gast2

Gast
Hallo,

Gibt es eine Möglichkeit von einer SWT Componente an den eingegeben Style wieder zu kommen?? z.B. SWT.MULTI, dass ich dann die 2 zurück bekomme???
 
G

Gast2

Gast
nee les die javadoc dann weißt dass es leider nicht so ist und wenn du es ausgeben lässt ist es auch nicht so....
 
G

Gast2

Gast
Ich würde gern unterscheiden ob es ein normales Textfeld ist oder eine Textarea... wie kann ich sowas abfragen????

Hier noch eine kleine Layout frage:

Code:
public class TestLayout {
  public static void main(String[] args) {
    final Display display = new Display();
    final Shell shell = new Shell(display, SWT.SHELL_TRIM);

    shell.setLayout( new GridLayout());

    final Group current = new Group(shell , SWT.NONE);
    current.setText("Group");
    current.setLayout(new GridLayout());
    current.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 3));
    final Label label = new Label(current, SWT.NONE);
    label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    label.setText("Test");
    final Text text = new Text (current, SWT.MULTI|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER);
    text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 3));
    shell.pack();
    shell.open();
    // Set up the event loop.
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        // If no more entries in event queue
        display.sleep();
      }
    }
    display.dispose();
  }


so ich möchte dass das Label an der gleichen stelle bleibt -->geht
ich möchte dass die Gruppe und die textarea nacht rechts sich vergrößert --> geht auch
ich möchte dass die Gruppe und textarea von anfang an 3 rows hat und nach unten nicht größer wird--> klappt solange bis man in das Textarea(am besten zeilenumbruch) etwas eingibt und dann ein resize macht dann nimmt das Textarea soviel Platz ein wie Text enthalten ist...
mhmmm warum??? Wie kann ich das Abstellen??
=)
 

Wildcard

Top Contributor
Code:
int style = text.getStyle();
if(style && SWT.MULTI == SWT.MULTI)
 
G

Gast2

Gast
ok das versuch ich mal
sollte so aber heißen
Code:
if ((style & SWT.MULTI) != SWT.MULTI)

also mit einem &
 
G

Gast2

Gast
hehe ;) für des layout problem mach ich mal einen neuen Thread auf =)
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen

Ähnliche Java Themen

Neue Themen


Oben