Eclipse: Step by Step (Step-by-Step series)

Step 9.7: Add a new class, Prompt

q 9.7(a) Make sure the SWT project is selected.

q 9.7(b) Using the Eclipse main menu bar, select New/Class.

Figure 9.51: Creating a new class using the main menu bar's New/Class option.

q 9.7(c) Make sure the Source Folder is SWT'.

q 9.7(d) Leave Package blank.

q 9.7(e) Leave Enclosing type unchecked.

q 9.7(f) Enter Prompt in the Name field.

q 9.7(g) Make sure public is checked, abstract and final unchecked.

q 9.7(h) Leave Superclass as java.lang.Object, Interfaces blank.

q 9.7(i) Make sure public static void main(String[] args) is checked.

q 9.7(j) Leave the other two unchecked.

q 9.7(k) Select Finish.

Figure 9.52: Setting the fields properly for a new class.

This will create a class Prompt in the default package (because you left package blank) in project SWT, as shown in Figure 9.53.

Figure 9.53: The result of the addition of the new class Prompt.

Категории