Unterschiede

Hier werden die Unterschiede zwischen der gewählten und der aktuellen Version gezeigt.

swt-jface:dialog 2009/01/15 16:51 swt-jface:dialog 2020/01/22 20:59 aktuell
Zeile 1: Zeile 1:
 +[[swt-jface:swt-jface|Java - SWT/JFace]]\\
====== Dialog (JFace) ====== ====== Dialog (JFace) ======
//org.eclipse.jface.dialogs.Dialog//\\ //org.eclipse.jface.dialogs.Dialog//\\
-Das Beispiel zeigt einen einfachen Dialog mit einem Label und einem Text-Feld:\\+\\ 
 +<html> 
 +  <script type="text/javascript"><!-- 
 +      google_ad_client="pub-9681858985507948"; 
 +      google_ad_width = 468; 
 +      google_ad_height = 60; 
 +      google_ad_format = "468x60_as"; 
 +      google_ad_type = "text"; 
 +      google_ad_channel = ""; 
 +      google_color_border = "cccccc"; 
 +      google_color_bg = "FFFFFF"; 
 +      google_color_link = "1d2d8c"; 
 +      google_color_text = "000000"; 
 +      google_color_url = "1d2d8c"; 
 +      //--> 
 +  </script> 
 +  <script type="text/javascript" 
 +      src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> 
 +  </script> 
 +</html> 
 +\\ 
 +\\ 
 +Das Beispiel zeigt einen einfachen Dialog mit einem Titel, welcher ein Label und ein Text-Feld enthält:\\
<code java> <code java>
public class MyDialog extends Dialog { public class MyDialog extends Dialog {
Zeile 9: Zeile 32:
  protected MyDialog(Shell parentShell) {   protected MyDialog(Shell parentShell) {
      super(parentShell);       super(parentShell);
 +  }
 + 
 +  @Override
 +  protected void configureShell(Shell shell) {
 +      super.configureShell(shell);
 +      shell.setText("MyTitle");  // Dialog-Titel setzen
  }   }
Zeile 15: Zeile 44:
      Composite composite = (Composite) super.createDialogArea(parent);       Composite composite = (Composite) super.createDialogArea(parent);
-      parent.setLayout(new GridLayout(1, false));+      composite.setLayout(new GridLayout(1, false));
-      label = new Label(parent, SWT.FLAT);+      label = new Label(composite, SWT.FLAT);
      GridData gdl = new GridData();       GridData gdl = new GridData();
      gdl.grabExcessHorizontalSpace = true;       gdl.grabExcessHorizontalSpace = true;
Zeile 23: Zeile 52:
      label.setText("Ihre Eingabe: ");       label.setText("Ihre Eingabe: ");
-      text = new Text(parent, SWT.FLAT|SWT.BORDER);+      text = new Text(composite, SWT.FLAT|SWT.BORDER);
      GridData gdt = new GridData();       GridData gdt = new GridData();
      gdt.grabExcessHorizontalSpace = true;       gdt.grabExcessHorizontalSpace = true;

Eigene Werkzeuge
Werkzeuge

gratis Counter by GOWEB
seit 9.10.2007