Using System Icon Image : WIN32 « SWT « Java Tutorial






Using System Icon Image
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;

public class SystemIconImage {

  public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setLayout(new RowLayout());


    Label label = new Label (shell, SWT.NONE);
    label.setImage(display.getSystemImage(SWT.ICON_ERROR));
    label = new Label (shell, SWT.NONE);
    label.setText("SWT.ICON_ERROR");
    label = new Label (shell, SWT.NONE);
    label.setImage(display.getSystemImage(SWT.ICON_INFORMATION));
    label = new Label (shell, SWT.NONE);
    label.setText("SWT.ICON_INFORMATION");
    label = new Label (shell, SWT.NONE);
    label.setImage(display.getSystemImage(SWT.ICON_WARNING));
    label = new Label (shell, SWT.NONE);
    label.setText("SWT.ICON_WARNING");
    label = new Label (shell, SWT.NONE);
    label.setImage(display.getSystemImage(SWT.ICON_QUESTION));
    label = new Label (shell, SWT.NONE);
    label.setText("SWT.ICON_QUESTION");

    shell.setSize(400, 350);
    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }

    display.dispose();
  }

}








17.127.WIN32
17.127.1.Using System Icon ImageUsing System Icon Image
17.127.2.Invoke the system text editor on autoexec.bat
17.127.3.Invoke an external batch file
17.127.4.Load System File IconLoad System File Icon
17.127.5.Embed Word in an applet (win32 only)
17.127.6.OLE and ActiveX: browse the typelibinfo for a program id (win32 only)
17.127.7.OLE and ActiveX: get events from IE control (win32 only)OLE and ActiveX: get events from IE control (win32 only)
17.127.8.How to access About, Preferences and Quit menus on carbon.
17.127.9.Add System Setting Change Listener
17.127.10.Detect a system settings changeDetect a system settings change