The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.
-
Upload
maximillian-hill -
Category
Documents
-
view
217 -
download
0
Transcript of The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.
![Page 1: The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649e3b5503460f94b2db28/html5/thumbnails/1.jpg)
The NetBeans IDE
CSIS 3701: Advanced Object Oriented Programming
![Page 2: The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649e3b5503460f94b2db28/html5/thumbnails/2.jpg)
Integrated Development Environment
• Single environment with tools for:– Generating and editing source code– Compiling and executing code– Testing and debugging code
• NetBeans IDE for Java– Available with Java from Sun (http://java.sun.com )– Available separately from http://www.netbeans.org – See “Homework 0” on course web site for more
details
![Page 3: The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649e3b5503460f94b2db28/html5/thumbnails/3.jpg)
NetBeans Organization
• Applications organized into projects– Contains all files associated with application
(source code, executables, testing, etc.)
• Projects contain packages– Groups of related files (like C++ libraries)
• Packages contain individual files– Each class in own file– Class is application if contains a main function
(can be executed in standalone mode)
![Page 4: The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649e3b5503460f94b2db28/html5/thumbnails/4.jpg)
Creating Projects
• Select File New Project
![Page 5: The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649e3b5503460f94b2db28/html5/thumbnails/5.jpg)
Creating Projects
• Choose Java as category and then Java Application
![Page 6: The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649e3b5503460f94b2db28/html5/thumbnails/6.jpg)
Creating Projects
• Give basic information about project– Project name– Where stored on computer
Automatically creates a “main” class with same name as project
![Page 7: The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649e3b5503460f94b2db28/html5/thumbnails/7.jpg)
Basic Project Structure
• Project listed on left
• Contains packages for that project
By default package with same name as project automatically created under Source Packages
• Package contains main class defined when project created
• Will see other packages besides source packages later (testing, etc.)
![Page 8: The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649e3b5503460f94b2db28/html5/thumbnails/8.jpg)
Editing a Class
• Source code written and edited in IDE• Color coded by type:
– Keywords blue– Identifiers green– Strings orange– Comments grey
![Page 9: The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649e3b5503460f94b2db28/html5/thumbnails/9.jpg)
Editing a Class
• Automatically checks syntax of class after every change• Syntax errors highlighted in red• Hints available on rollover
![Page 10: The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649e3b5503460f94b2db28/html5/thumbnails/10.jpg)
Compiling and Running a Project
• Can compile (“build”) and run from Run menu– Running automatically saves and compiles project
– Can use shortcut
![Page 11: The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649e3b5503460f94b2db28/html5/thumbnails/11.jpg)
Running a Project
• Code executed starting in main method of the main class• GUI output popped up in
separate window
• Text written to standard output displayed in “Output” tab on bottom of NetBeans window