FileDocCategorySizeDatePackage
Gui_4.javaAPI DocExample8950Mon Nov 17 15:22:20 GMT 2003org.eclipsebook.ch07

Gui_4

public class Gui_4 extends Object
user code imports V4ALL Entry Level

Fields Summary
private Shell
ivjFrame100
private Button
ivjButton100
private org.eclipse.swt.widgets.Label
ivjLabel100
Constructors Summary
public Gui_4(String title)
Gui_4 constructor comment.

param
title java.lang.String

       
  
	getFrame100().setText(title);
Methods Summary
private ButtongetButton100()
V4ALL Entry Level Return the Button100 property value.

return
Buttonl

    if (ivjButton100 == null) {
        try {
           ivjButton100 = new Button(getFrame100(), SWT.NULL);
           ivjButton100.setText("Click Me");
           ivjButton100.setBounds(80, 76, 85, 25);
           ivjButton100.setForeground(new Color(null, 0, 0, 0));
           ivjButton100.addSelectionListener (new SelectionAdapter () {
           	public void widgetSelected (SelectionEvent e) {
                processEvent();
                // user code begin {3} SWT
                // user code end
              };
           });
           // user code begin {1} Swing
           // user code end
           // user code begin {1} SWT
           // user code end
           // user code begin {1} HTML
           // user code end
           // user code begin {1} Eclipse
           // user code end
           // user code begin {1} C#
           // user code end
        } catch (java.lang.Throwable ivjExc) {
           // user code begin {2} Swing
           // user code end
           // user code begin {2} SWT
           // user code end
           // user code begin {2} HTML
           // user code end
           // user code begin {2} Eclipse
           // user code end
           // user code begin {2} C#
           // user code end
        handleException(ivjExc);
        }
    }
    return ivjButton100;
public ShellgetFrame100()
Return the Frame100 property value.

return
Shell

	if(ivjFrame100==null){
        try {
			Display display = new Display();
			ivjFrame100 = new Shell(display);
           ivjFrame100.setBounds(47, 55, 365, 184);
           ivjFrame100.setForeground(new Color(null, 0, 0, 0));
	         int height = java.awt.Toolkit.getDefaultToolkit().getScreenSize().height;
	         int width  = java.awt.Toolkit.getDefaultToolkit().getScreenSize().width;
           ivjFrame100.setLocation(width/2 - 365/2, height/2 - 184/2);
          // user code begin {1} Swing
          // user code end
          // user code begin {1} SWT
          // user code end
          // user code begin {1} HTML
          // user code end
          // user code begin {1} Eclipse
          // user code end
          // user code begin {1} C#
          // user code end
        } catch (java.lang.Throwable ivjExc) {
          // user code begin {1} Swing
          // user code end
          // user code begin {1} SWT
          // user code end
          // user code begin {1} HTML
          // user code end
          // user code begin {1} Eclipse
          // user code end
          // user code begin {1} C#
          // user code end
        handleException(ivjExc);
        }
	}
	return ivjFrame100;
private org.eclipse.swt.widgets.LabelgetLabel100()
V4ALL Entry Level Return the Label100 property value.

return
org.eclipse.swt.widgets.Labell

    if (ivjLabel100 == null) {
        try {
           ivjLabel100 = new org.eclipse.swt.widgets.Label(getFrame100(), SWT.NULL);
           ivjLabel100.setText(" ");
           ivjLabel100.setBounds(218, 76, 82, 23);
           ivjLabel100.setForeground(new Color(null, 0, 0, 0));
           // user code begin {1} Swing
           // user code end
           // user code begin {1} SWT
           // user code end
           // user code begin {1} HTML
           // user code end
           // user code begin {1} Eclipse
           // user code end
           // user code begin {1} C#
           // user code end
        } catch (java.lang.Throwable ivjExc) {
           // user code begin {2} Swing
           // user code end
           // user code begin {2} SWT
           // user code end
           // user code begin {2} HTML
           // user code end
           // user code begin {2} Eclipse
           // user code end
           // user code begin {2} C#
           // user code end
        handleException(ivjExc);
        }
    }
    return ivjLabel100;
private voidhandleException(java.lang.Throwable exception)
V4ALL Entry Level Called whenever the part throws an exception.

param
exception java.lang.Throwable

	/* Uncomment the following lines to print uncaught exceptions to stdout */
    // System.out.println("--------- UNCAUGHT EXCEPTION ---------");
    // exception.printStackTrace(System.out);
private voidinitConnections()
Initializes connections

exception
java.lang.Exception The exception description.

    // user code begin {1} Swing
    // user code end
    // user code begin {1} SWT
    // user code end
    // user code begin {1} HTML
    // user code end
    // user code begin {1} Eclipse
    // user code end
    // user code begin {1} C#
    // user code end
    // user code begin {2} Swing
    // user code end
    // user code begin {2} SWT
    // user code end
    // user code begin {2} HTML
    // user code end
    // user code begin {2} Eclipse
    // user code end
    // user code begin {2} C#
    // user code end
private voidinitialize()
Initialize the class.

    try {
        // user code begin {1} Swing
        // user code end
        // user code begin {1} SWT
        // user code end
        // user code begin {1} HTML
        // user code end
        // user code begin {1} Eclipse
        // user code end
        // user code begin {1} C#
        // user code end
        initConnections();
        // user code begin {2} Swing
        // user code end
        // user code begin {2} SWT
        // user code end
        // user code begin {2} HTML
        // user code end
        // user code begin {2} Eclipse
        // user code end
        // user code begin {2} C#
        // user code end
     }
     catch (java.lang.Throwable ivjExc) {
         handleException(ivjExc);
     }
public static voidmain(java.lang.String[] args)
main entrypoint - starts the part when it is run as an application

param
args java.lang.String[]

    try {
        Gui_4 aGui_4;
		aGui_4 = new Gui_4("Frame");
		aGui_4.getFrame100();
		aGui_4.getButton100();
		aGui_4.getLabel100();
		aGui_4.getFrame100().open();
		while (! aGui_4.getFrame100().isDisposed()) {
			if (! aGui_4.getFrame100().getDisplay().readAndDispatch())
				aGui_4.getFrame100().getDisplay().sleep();
		}
		aGui_4.getFrame100().dispose();
    }
    catch (Throwable exception) {
        System.err.println("Exception occurred in main() of javax.swing.JFrame");
        exception.printStackTrace(System.out);
    }
 
public voidprocessEvent()
user code methods V4ALL Entry Level

    // user code begin {1} Swing
    // user code end
    // user code begin {1} SWT
    ivjLabel100.setText("No worries.");
    // user code end
    // user code begin {1} HTML
    // user code end
    // user code begin {1} Eclipse
    // user code end
    // user code begin {1} C#
    // user code end