SlideShare a Scribd company logo
Using JCreator
JCreator is an integrated development environment (IDE). An IDE vides a
workspace that allows for editing, compiling, and running of source code.
The JCreator IDE has a graphical user interface, which makes it easy to
learn and use.
The JCreator IDE can be used to create Java applets, console applications,
and Swing applications. JCreator maintains each applet and application as
a project. Projects are created in a workspace environment, which consists
of several windows:
.  The File View window displays the folders and files associated
with the project workspace.
 The Package View window displays the classes associated with
the project workspace.
 The code editor window is used to type and edit Java and HTML
code.
 The Output window displays Java program output, build errors,
a task list, and debug output.

FileView 
window
PackageView
window
—code editor
window
To start JCreator, double-click on the Desktop Icon or select Start - All Programs - JCreator
JCreator. When JCreator is started, if an existing workspace is open, it is important to select File Close
Workspace before creating a new project because a workspace can contain more than one project.
Compiling and Running a Program
In JCreator, a Java applet or application must be compiled before it is run. Compiling automatically saves
the program file and converts the Java source code to bytecode. Select Build — Compile Project or click the
Compile Project ( ) button on the toolbar to compile the program. If the program compiles successfully,
the message "Process completed." will appear in the Build Output window. Next, select Build Execute
Project or click the Execute Project (la - button on the toolbar to run the program and display the
program output in a window.
Java applets can be viewed in a website. Applets are created in Unit 4. JCreator contains a Basic Java Applet
template that can be modified to easily create Java Applets. JCreator also contains an Applet Viewer that is
used to view applets as they will appear on a web page. If the Basic Java Applet template is not modified,
it will appear similar to the window below when it is compiled and run in JCreator:
JCreator Basic Java Applet template displayed in the
JCreator Applet Viewer
To create a Java Applet, select File New - Project and then select Basic
Java Applet from the Project Wizard dialog box. Select Next to display the
second Project Wizard dialog box. In the Name box, type a descriptive
applet name, verify that the project paths are correct in the Location, Source
Path, and Output Path boxes. If the project paths are not
correct, click beside the corresponding box and select the
appropriate path from the Select Directory dialog box.
Select Finish to create the project workspace, folders, and
files.
A Basic Java application template automatically
generates a .java file and an .htm file. To create an
applet, first modify and compile the .java file. Select File -
 Execute Project to view the applet in the JCreator Applet
Viewer. Next, modify the .htm file so that the applet is
appropriately placed in the HTML document. The applet
can then be viewed in a web browser.
Review: Welcome
START 'CREATOR
CREATE A NEW PROJECT
a. Select File - New Project. The Project Wizard dialog box is displayed.
b. In the Project Wizard dialog box, select Basic Java Applet:
Select Next. The second Project Wizard dialog box is displayed.
In the Name box, type Welcome:
e. Verify that the project paths are correct in the Location, Source Path, and Output Path
boxes. If the project paths are not correct, click beside the corresponding box and
select the appropriate path from the Select Directory dialog box.
f. Select Create new workspace, if it is not already selected.
g. Select Finish. The File View window displays the folders and files associated with the
Basic Java Applet template.
h. Click it to expand the two project folders:
i. Double-click Welcome.java to display the Java template file in the code editor
window.
EDIT TEMPLATE SOURCE CODE
a. In line 6, change @author to your name.
b. In line 19, change "Welcome to Java!!" to This
change "50, 60" to 100, 100:

is my first Java Applet! ! and
COMPILE THE JAVA SOURCE CODE
Select Build - Compile Project. The Java source code is saved and "Process completed."
is displayed in the Build Output window.
VIEW THE APPLET IN JCREATOR VIEWER
a. Select Build - Execute Project. The applet is displayed in the JCreator Applet
Viewer.
b. Close the Applet Viewer window.
OPEN AND EDIT THE WELCOME.HTM FILE
a. In the File View window, double-click Welcome. htm to display the HTML template
file in the code editor window.
b.Change <BODY BGCOLOR="000000"> to <BODY BGC0L0R="006400">.
c.Change the width to 400.
d. Change the height to 200.
e. Select File -* Save. The Welcome. htm file is saved.
QUIT JCREATOR
VIEW THE APPLET IN A BROWSER
NOTES : Project files for a console application will include
 the Java source code (.java),
 the Java bytecode (.class),
 the workspace description file(.jcw)
 and the project description file (.jcp)
A PROJECT MUST HAVE THE SAME NAME AS THEF FILE THAT
CONTAINS THE CONTROLLING CLASS
CREATING A CONSOLE APPLICATION
A console application displays output in a DOS window. Console applications are created in Chapters 3
through 10 and Chapters 12 through 14. To create a console application, select File - New -• Project and
then select Empty Project from the Project Wizard dialog box. Select Next to display the second Project
Wizard dialog box. In the Name box, type a descriptive application name, verify that the project paths are
correct in the Location, Source Path, and Output Path boxes. If the project paths are not correct, click
beside the corresponding box and select the appropriate path from the Select Directory dialog box.
Select Finish to create the project workspace and folder.
A new Java file is then created by selecting File New -+ File or clicking the New File button (j _II) on
the toolbar, which displays the File Wizard dialog box. In the Name box, type the same name as the
application name and then select Finish.
After typing a program, select File y Save All to save the program file(s) and select File y Save Workspace
to associate the file with the workspace. If the workspace is not saved, the added program file will not
appear in the File View window when the project workspace is opened even though the program file is in
the project directory. When finished working in JCreator, select File y Exit to remove the JCreator IDE
from the Desktop
.
Review: Message part 1 of 2
You will create a project named Message.
START 'CREATOR
Select File Close Workspace if an existing project is displayed when the IDE is
0started.
CREATE A NEW PROJECT
a. Select File New Project. The Project Wizard dialog box is displayed.
b. In the Project Wizard dialog box, select Empty Project:
c. Select Next. The second Project Wizard dialog box is displayed.
d. In the Name box, type Message:
e. Verify that the project paths are correct in the Location, Source Path, and Output Path boxes.
If the project paths are not correct, click Q beside the corresponding box and select the
appropriate path from the Select Directory dialog box.
f. Select Create new workspace, if it is not already selected.
g. Select Finish. The Message workspace file and project folder are displayed in the File
View window.
ADD A FILE TO THE PROJECT
On the toolbar, click the New File button. The File Wizard dialog box is
displayed.
Select File Type if it is not already selected.
Select Java File if it is not already selected and then select Next.
In the Name box, type Message:
Select Finish. A Message.java file is created.
ENTER A JAVA PROGRAM
In the code editor window, type the following program:
COMPILE AND RUN MESSAGE
a. Select Build Compile Project. The Message.java file is saved and the message
"Process completed." is displayed in the Build Output window:
b. Select Build Execute Project. The program output window is displayed:
Note that your screen may be white and black text. Click in to change the output
window options.
c. Press any key to remove the output window.
SAVE THE WORKSPACE AND QUIT JCREATOR
a. Select File - Save Workspace. The project workspace is saved.
b. Select File -• Close Workspace.
The JCreator compiler will display any errors in the Task List window when the program is compiled:
The Task List displays a description of the error and the error location
Double-click the error message to display a red arrow next to the line of code containing the error. To remove
an error message, correct the error and then compile the project.
Opening a Project Workspace and Printing
To open a project's workspace, select File - Open Workspace. Use the Look in list and contents box to display
the appropriate workspace file and then select Open.
To print the source code, click the code editor window and then select File -• Print. To print the contents of
the output window, select SI -• Edit Select All and then select SI Edit y
Copy. The contents can then be pasted
into a word processor and printed.
You will open the Message workspace and print the code.
OPEN MESSAGE WORKSPACE
a. Select File — Open Workspace. A dialog box is displayed.
b. Use the Look in list and the contents box below it to display file name Message.
c. In the contents box, click Message and then select Open.
PRINT MESSAGE
a. In the File View window, double-click Message.java.
b. Click the code editor window.
c. Select File - Print.
CLOSE THE MESSAGE WORKSPACE ®
QUIT JCREATOR
Adding Files to a Project
A Java application can include multiple classes. Only one class is the controlling class. Other classes define
abstract types used in the controlling class or within the additional classes. Applications that contain
multiple classes are created in Chapters 8 through 14.
To add a new class to a project, add a file to the project and then type the new class code in this file. To
add an existing class to a project, select Project -• Add Files, which displays the Open dialog box. Use the
Look in list and contents box to display the appropriate file. Select the file and then select Open.
JCreator has several help
features that can be accessed in the Help menu. The Help Contents and JDK Help commands access a
database of help topics that can be searched and the JCreator on the Web command provides links to
technical support information on the JCreator website.

More Related Content

What's hot

Visual Programming
Visual ProgrammingVisual Programming
Visual Programming
Bagzzz
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0sanket1996
 
Vbasic
VbasicVbasic
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programmingRoger Argarin
 
Lab1
Lab1Lab1
Lab1
rksrks
 
Dbva dotnet programmer_guide_chapter8
Dbva dotnet programmer_guide_chapter8Dbva dotnet programmer_guide_chapter8
Dbva dotnet programmer_guide_chapter8Shakeel Mujahid
 
Vb unit t 1.1
Vb unit t 1.1Vb unit t 1.1
Vb unit t 1.1
Gayathri Cit
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginner
Salim M
 
Vp lecture1 ararat
Vp lecture1 araratVp lecture1 ararat
Vp lecture1 ararat
Saman M. Almufti
 
Chapter 03 - Program Coding and Design
Chapter 03 - Program Coding and DesignChapter 03 - Program Coding and Design
Chapter 03 - Program Coding and Design
patf719
 
Visual basic
Visual basicVisual basic
Visual basicDharmik
 
Chapter 01: Intro to VB2010 Programming
Chapter 01: Intro to VB2010 ProgrammingChapter 01: Intro to VB2010 Programming
Chapter 01: Intro to VB2010 Programming
patf719
 
Csharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoCsharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoMamgmo Magnda
 
04 conexão logo! 0 ba7 com ihm
04 conexão logo! 0 ba7 com ihm04 conexão logo! 0 ba7 com ihm
04 conexão logo! 0 ba7 com ihmconfidencial
 

What's hot (18)

Visual Programming
Visual ProgrammingVisual Programming
Visual Programming
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
 
Vbasic
VbasicVbasic
Vbasic
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
 
Vb introduction.
Vb introduction.Vb introduction.
Vb introduction.
 
Lab1
Lab1Lab1
Lab1
 
Dbva dotnet programmer_guide_chapter8
Dbva dotnet programmer_guide_chapter8Dbva dotnet programmer_guide_chapter8
Dbva dotnet programmer_guide_chapter8
 
Vb unit t 1.1
Vb unit t 1.1Vb unit t 1.1
Vb unit t 1.1
 
Vb tutorial
Vb tutorialVb tutorial
Vb tutorial
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginner
 
Vp lecture1 ararat
Vp lecture1 araratVp lecture1 ararat
Vp lecture1 ararat
 
Chapter 03 - Program Coding and Design
Chapter 03 - Program Coding and DesignChapter 03 - Program Coding and Design
Chapter 03 - Program Coding and Design
 
Visual basic
Visual basicVisual basic
Visual basic
 
Meaning Of VB
Meaning Of VBMeaning Of VB
Meaning Of VB
 
Chapter 01: Intro to VB2010 Programming
Chapter 01: Intro to VB2010 ProgrammingChapter 01: Intro to VB2010 Programming
Chapter 01: Intro to VB2010 Programming
 
Csharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoCsharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul Yao
 
Visual programming
Visual programmingVisual programming
Visual programming
 
04 conexão logo! 0 ba7 com ihm
04 conexão logo! 0 ba7 com ihm04 conexão logo! 0 ba7 com ihm
04 conexão logo! 0 ba7 com ihm
 

Viewers also liked

Java lab1 manual
Java lab1 manualJava lab1 manual
Java lab1 manual
nahalomar
 
Interfaz+grafica+de+usuario
Interfaz+grafica+de+usuarioInterfaz+grafica+de+usuario
Interfaz+grafica+de+usuarioMARTO3000
 
Pengenalan Jcreator
Pengenalan JcreatorPengenalan Jcreator
Pengenalan Jcreator
daffa12
 
Inicio jcreator practica1
Inicio jcreator practica1Inicio jcreator practica1
Inicio jcreator practica1
MARTO3000
 
Tutorial jcreator claudia laguna coronel
Tutorial jcreator  claudia laguna coronelTutorial jcreator  claudia laguna coronel
Tutorial jcreator claudia laguna coronelClaudiaLagunaCoronel
 
Instalación JDK & Jcreator
Instalación JDK & JcreatorInstalación JDK & Jcreator
Instalación JDK & JcreatorRafael Orozco
 
Ejercicios resueltos de java
Ejercicios resueltos de javaEjercicios resueltos de java

Viewers also liked (7)

Java lab1 manual
Java lab1 manualJava lab1 manual
Java lab1 manual
 
Interfaz+grafica+de+usuario
Interfaz+grafica+de+usuarioInterfaz+grafica+de+usuario
Interfaz+grafica+de+usuario
 
Pengenalan Jcreator
Pengenalan JcreatorPengenalan Jcreator
Pengenalan Jcreator
 
Inicio jcreator practica1
Inicio jcreator practica1Inicio jcreator practica1
Inicio jcreator practica1
 
Tutorial jcreator claudia laguna coronel
Tutorial jcreator  claudia laguna coronelTutorial jcreator  claudia laguna coronel
Tutorial jcreator claudia laguna coronel
 
Instalación JDK & Jcreator
Instalación JDK & JcreatorInstalación JDK & Jcreator
Instalación JDK & Jcreator
 
Ejercicios resueltos de java
Ejercicios resueltos de javaEjercicios resueltos de java
Ejercicios resueltos de java
 

Similar to Lvp jcreator

Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docxModule Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
roushhsiu
 
Supplement2d netbeans6
Supplement2d netbeans6Supplement2d netbeans6
Supplement2d netbeans6
adrianyourlust1998
 
Prg 218 entire course
Prg 218 entire coursePrg 218 entire course
Prg 218 entire course
grades4u
 
Containers Lab
Containers Lab Containers Lab
Containers Lab
Dev_Events
 
Introduction to Android and Java.pptx
Introduction to Android and Java.pptxIntroduction to Android and Java.pptx
Introduction to Android and Java.pptx
GandhiMathy6
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
EliasPetros
 
Visual c++ 2010_tutorial
Visual c++ 2010_tutorialVisual c++ 2010_tutorial
Visual c++ 2010_tutorial
Ayub Abd Rahman
 
Creating a word file by a template
Creating a word file by a templateCreating a word file by a template
Creating a word file by a template
aepetelin
 
codeblocks-instructions.pdf
codeblocks-instructions.pdfcodeblocks-instructions.pdf
codeblocks-instructions.pdf
RavinderKSingla
 
Oracle ADF 11g Skinning Tutorial
Oracle ADF 11g Skinning TutorialOracle ADF 11g Skinning Tutorial
Oracle ADF 11g Skinning Tutorial
Rakesh Gujjarlapudi
 
C# with Renas
C# with RenasC# with Renas
C# with Renas
Renas Rekany
 
Membangun Desktop App
Membangun Desktop AppMembangun Desktop App
Membangun Desktop App
Fajar Baskoro
 
iPhone application development training day 1
iPhone application development training day 1iPhone application development training day 1
iPhone application development training day 1Shyamala Prayaga
 
Visual c++ demo
Visual c++ demoVisual c++ demo
Visual c++ demo
Dr. C.V. Suresh Babu
 
Visual studio 2012
Visual studio 2012Visual studio 2012
Visual studio 2012
Kiru Dennis
 
Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812
Pantech ProLabs India Pvt Ltd
 
1. deploying an asp.net web application
1. deploying an asp.net web application1. deploying an asp.net web application
1. deploying an asp.net web application
Pramod Rathore
 
How to work with code blocks
How to work with code blocksHow to work with code blocks
How to work with code blocks
Tech Bikram
 
Components lab
Components labComponents lab
Components lab
IBM Rational software
 
Cis 170 Education Organization / snaptutorial.com
Cis 170 Education Organization / snaptutorial.comCis 170 Education Organization / snaptutorial.com
Cis 170 Education Organization / snaptutorial.com
Baileya126
 

Similar to Lvp jcreator (20)

Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docxModule Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
Module Six Assignment Guidelines and Rubric.htmlOverviewMa.docx
 
Supplement2d netbeans6
Supplement2d netbeans6Supplement2d netbeans6
Supplement2d netbeans6
 
Prg 218 entire course
Prg 218 entire coursePrg 218 entire course
Prg 218 entire course
 
Containers Lab
Containers Lab Containers Lab
Containers Lab
 
Introduction to Android and Java.pptx
Introduction to Android and Java.pptxIntroduction to Android and Java.pptx
Introduction to Android and Java.pptx
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
 
Visual c++ 2010_tutorial
Visual c++ 2010_tutorialVisual c++ 2010_tutorial
Visual c++ 2010_tutorial
 
Creating a word file by a template
Creating a word file by a templateCreating a word file by a template
Creating a word file by a template
 
codeblocks-instructions.pdf
codeblocks-instructions.pdfcodeblocks-instructions.pdf
codeblocks-instructions.pdf
 
Oracle ADF 11g Skinning Tutorial
Oracle ADF 11g Skinning TutorialOracle ADF 11g Skinning Tutorial
Oracle ADF 11g Skinning Tutorial
 
C# with Renas
C# with RenasC# with Renas
C# with Renas
 
Membangun Desktop App
Membangun Desktop AppMembangun Desktop App
Membangun Desktop App
 
iPhone application development training day 1
iPhone application development training day 1iPhone application development training day 1
iPhone application development training day 1
 
Visual c++ demo
Visual c++ demoVisual c++ demo
Visual c++ demo
 
Visual studio 2012
Visual studio 2012Visual studio 2012
Visual studio 2012
 
Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812
 
1. deploying an asp.net web application
1. deploying an asp.net web application1. deploying an asp.net web application
1. deploying an asp.net web application
 
How to work with code blocks
How to work with code blocksHow to work with code blocks
How to work with code blocks
 
Components lab
Components labComponents lab
Components lab
 
Cis 170 Education Organization / snaptutorial.com
Cis 170 Education Organization / snaptutorial.comCis 170 Education Organization / snaptutorial.com
Cis 170 Education Organization / snaptutorial.com
 

Lvp jcreator

  • 1. Using JCreator JCreator is an integrated development environment (IDE). An IDE vides a workspace that allows for editing, compiling, and running of source code. The JCreator IDE has a graphical user interface, which makes it easy to learn and use. The JCreator IDE can be used to create Java applets, console applications, and Swing applications. JCreator maintains each applet and application as a project. Projects are created in a workspace environment, which consists of several windows: .  The File View window displays the folders and files associated with the project workspace.  The Package View window displays the classes associated with the project workspace.  The code editor window is used to type and edit Java and HTML code.  The Output window displays Java program output, build errors, a task list, and debug output.  FileView  window PackageView window —code editor window
  • 2. To start JCreator, double-click on the Desktop Icon or select Start - All Programs - JCreator JCreator. When JCreator is started, if an existing workspace is open, it is important to select File Close Workspace before creating a new project because a workspace can contain more than one project. Compiling and Running a Program In JCreator, a Java applet or application must be compiled before it is run. Compiling automatically saves the program file and converts the Java source code to bytecode. Select Build — Compile Project or click the Compile Project ( ) button on the toolbar to compile the program. If the program compiles successfully, the message "Process completed." will appear in the Build Output window. Next, select Build Execute Project or click the Execute Project (la - button on the toolbar to run the program and display the program output in a window. Java applets can be viewed in a website. Applets are created in Unit 4. JCreator contains a Basic Java Applet template that can be modified to easily create Java Applets. JCreator also contains an Applet Viewer that is used to view applets as they will appear on a web page. If the Basic Java Applet template is not modified, it will appear similar to the window below when it is compiled and run in JCreator: JCreator Basic Java Applet template displayed in the JCreator Applet Viewer To create a Java Applet, select File New - Project and then select Basic Java Applet from the Project Wizard dialog box. Select Next to display the second Project Wizard dialog box. In the Name box, type a descriptive applet name, verify that the project paths are correct in the Location, Source
  • 3. Path, and Output Path boxes. If the project paths are not correct, click beside the corresponding box and select the appropriate path from the Select Directory dialog box. Select Finish to create the project workspace, folders, and files. A Basic Java application template automatically generates a .java file and an .htm file. To create an applet, first modify and compile the .java file. Select File -  Execute Project to view the applet in the JCreator Applet Viewer. Next, modify the .htm file so that the applet is appropriately placed in the HTML document. The applet can then be viewed in a web browser. Review: Welcome START 'CREATOR CREATE A NEW PROJECT a. Select File - New Project. The Project Wizard dialog box is displayed. b. In the Project Wizard dialog box, select Basic Java Applet: Select Next. The second Project Wizard dialog box is displayed. In the Name box, type Welcome:
  • 4. e. Verify that the project paths are correct in the Location, Source Path, and Output Path boxes. If the project paths are not correct, click beside the corresponding box and select the appropriate path from the Select Directory dialog box. f. Select Create new workspace, if it is not already selected. g. Select Finish. The File View window displays the folders and files associated with the Basic Java Applet template. h. Click it to expand the two project folders: i. Double-click Welcome.java to display the Java template file in the code editor window. EDIT TEMPLATE SOURCE CODE a. In line 6, change @author to your name.
  • 5. b. In line 19, change "Welcome to Java!!" to This change "50, 60" to 100, 100:  is my first Java Applet! ! and COMPILE THE JAVA SOURCE CODE Select Build - Compile Project. The Java source code is saved and "Process completed." is displayed in the Build Output window. VIEW THE APPLET IN JCREATOR VIEWER a. Select Build - Execute Project. The applet is displayed in the JCreator Applet Viewer. b. Close the Applet Viewer window. OPEN AND EDIT THE WELCOME.HTM FILE a. In the File View window, double-click Welcome. htm to display the HTML template file in the code editor window. b.Change <BODY BGCOLOR="000000"> to <BODY BGC0L0R="006400">. c.Change the width to 400. d. Change the height to 200. e. Select File -* Save. The Welcome. htm file is saved. QUIT JCREATOR VIEW THE APPLET IN A BROWSER
  • 6. NOTES : Project files for a console application will include  the Java source code (.java),  the Java bytecode (.class),  the workspace description file(.jcw)  and the project description file (.jcp) A PROJECT MUST HAVE THE SAME NAME AS THEF FILE THAT CONTAINS THE CONTROLLING CLASS CREATING A CONSOLE APPLICATION A console application displays output in a DOS window. Console applications are created in Chapters 3 through 10 and Chapters 12 through 14. To create a console application, select File - New -• Project and then select Empty Project from the Project Wizard dialog box. Select Next to display the second Project Wizard dialog box. In the Name box, type a descriptive application name, verify that the project paths are correct in the Location, Source Path, and Output Path boxes. If the project paths are not correct, click beside the corresponding box and select the appropriate path from the Select Directory dialog box. Select Finish to create the project workspace and folder. A new Java file is then created by selecting File New -+ File or clicking the New File button (j _II) on the toolbar, which displays the File Wizard dialog box. In the Name box, type the same name as the application name and then select Finish. After typing a program, select File y Save All to save the program file(s) and select File y Save Workspace to associate the file with the workspace. If the workspace is not saved, the added program file will not appear in the File View window when the project workspace is opened even though the program file is in the project directory. When finished working in JCreator, select File y Exit to remove the JCreator IDE from the Desktop
  • 7. . Review: Message part 1 of 2 You will create a project named Message. START 'CREATOR Select File Close Workspace if an existing project is displayed when the IDE is 0started. CREATE A NEW PROJECT a. Select File New Project. The Project Wizard dialog box is displayed. b. In the Project Wizard dialog box, select Empty Project: c. Select Next. The second Project Wizard dialog box is displayed. d. In the Name box, type Message:
  • 8. e. Verify that the project paths are correct in the Location, Source Path, and Output Path boxes. If the project paths are not correct, click Q beside the corresponding box and select the appropriate path from the Select Directory dialog box. f. Select Create new workspace, if it is not already selected. g. Select Finish. The Message workspace file and project folder are displayed in the File View window. ADD A FILE TO THE PROJECT On the toolbar, click the New File button. The File Wizard dialog box is displayed. Select File Type if it is not already selected. Select Java File if it is not already selected and then select Next. In the Name box, type Message:
  • 9. Select Finish. A Message.java file is created.
  • 10. ENTER A JAVA PROGRAM In the code editor window, type the following program: COMPILE AND RUN MESSAGE a. Select Build Compile Project. The Message.java file is saved and the message "Process completed." is displayed in the Build Output window: b. Select Build Execute Project. The program output window is displayed: Note that your screen may be white and black text. Click in to change the output window options. c. Press any key to remove the output window. SAVE THE WORKSPACE AND QUIT JCREATOR a. Select File - Save Workspace. The project workspace is saved. b. Select File -• Close Workspace.
  • 11. The JCreator compiler will display any errors in the Task List window when the program is compiled: The Task List displays a description of the error and the error location Double-click the error message to display a red arrow next to the line of code containing the error. To remove an error message, correct the error and then compile the project. Opening a Project Workspace and Printing To open a project's workspace, select File - Open Workspace. Use the Look in list and contents box to display the appropriate workspace file and then select Open. To print the source code, click the code editor window and then select File -• Print. To print the contents of the output window, select SI -• Edit Select All and then select SI Edit y Copy. The contents can then be pasted into a word processor and printed. You will open the Message workspace and print the code. OPEN MESSAGE WORKSPACE a. Select File — Open Workspace. A dialog box is displayed. b. Use the Look in list and the contents box below it to display file name Message. c. In the contents box, click Message and then select Open. PRINT MESSAGE a. In the File View window, double-click Message.java. b. Click the code editor window. c. Select File - Print. CLOSE THE MESSAGE WORKSPACE ® QUIT JCREATOR
  • 12. Adding Files to a Project A Java application can include multiple classes. Only one class is the controlling class. Other classes define abstract types used in the controlling class or within the additional classes. Applications that contain multiple classes are created in Chapters 8 through 14. To add a new class to a project, add a file to the project and then type the new class code in this file. To add an existing class to a project, select Project -• Add Files, which displays the Open dialog box. Use the Look in list and contents box to display the appropriate file. Select the file and then select Open. JCreator has several help features that can be accessed in the Help menu. The Help Contents and JDK Help commands access a database of help topics that can be searched and the JCreator on the Web command provides links to technical support information on the JCreator website.