EIE375 BlueJ: Getting Started Dr Lawrence Cheung.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

MT311 Tutorial Li Tak Sing( 李德成 ). Uploading your work You need to upload your work for tutorials and assignments at the following site:
How to Create a Java program CS115 Fall George Koutsogiannakis.
Java Programming Working with TextPad. Using TextPad to Work with Java This text editor is designed for working with Java You can download a trial version.
Introduction to Java Lab CS110A – Lab Section 004 Instructor: Duo Wei.
Java Intro. A First Java Program //The Hello, World! program in Java public class Hello { public static void main(String[] args) { System.out.println("Hello,
Introduction to Java ISYS 350. A Brief History Sun Microsystems released this language in 1996 – Versions: 1.0 – 1.6 Java Development Kit, JDK – Standard.
Lab 1 Instructor: Jolanta Soltis.
Introduction to Java.
Marlene Galea.  The JDK (Java Development Kit)  An IDE (Integrated Development Environment) ◦ Different IDEs include:  JCreator  NetBeans  BlueJ.
Editing Java programs with the BlueJ IDE. Working environments to develop (= write) programs There are 2 ways to develop (write) computer programs: 1.Using.
public static void main (String[] args)
So – You want to learn how to put an advanced article submission (cut and paste) onto the state website. (Note: If you have not done so, you will need.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
From BlueJ to NetBeans SWC 2.semester.
(C) 2010 Pearson Education, Inc. All rights reserved.  Java programs normally go through five phases  edit  compile  load  verify  execute.
1 v1.6 08/02/2006 Overview of Eclipse Lectures 1.Overview 2.Installing and Running 3.Building and Running Java Classes 4.Refactoring 5.Debugging 6.Testing.
Author: Loh Jianxiong Christopher Editors: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang.
ACM/JETT Workshop - August 4-5, Guidelines For Using BlueJ.
UCSC All rights reserved. No part of this material may be reproduced and sold. 1 IT1202-Fundamentals Of Programming (Using JAVA) Interacting with.
Java and C# [this is a bonus – it is not a required lesson] ACO101: Introduction to Computer Science.
POS 406 Java Technology And Beginning Java Code
Clement Allen, PhD Florida A&M University SUMMER 2006.
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Active-HDL Interfaces Debugging C Code Course 10.
Copyright © Curt Hill Turtles The beginning of media computation.
9/2/ CS171 -Math & Computer Science Department at Emory University.
Setting Up Eclipse. What is Eclipse? Eclipse is a free, downloadable software that allows us to create, compile, and run JAVA programs.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
GumTree Development Environment Setup Windows Only Compatible with Eclipse 3.2 M3 (Last update: 16/11/05)
Preliminaries CS 310: Object-oriented Programming Java API.
1 CSC/ECE 517 Fall 2010 Lec. 3 Overview of Eclipse Lectures Lecture 2 “Lecture 0” Lecture 3 1.Overview 2.Installing and Running 3.Building and Running.
JAVA Practical Creating our first program 2. Source code file 3. Class file 4. Understanding the different parts of our program 5. Escape characters.
 Instructor: Dr. Jason Nichols –  Office Hours: – 9:30-10:30 M/W/F or by appointment – Business Building.
Java Programming, Second Edition Appendix A Working with Java SDK 1.4.
Hitchhiker’s Guide to CS Lee Sieger, Tim Cook, Jason Day, Zuozhi Yang.
Eclipse Project. Installing Visit to download a copy for your home computerhttp:// –Get Release version 3.0 (or.
Author: Loh Jianxiong Christopher Contributions: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang, Tong Chun Kit, Tania Chattopadhyay.
Compiling and running Java programs with BlueJ. Successfully compiled files program files in BlueJ You can tell from the shade of a program icon in BlueJ.
CHAPTER 1 INTRODUCTION. CHAPTER GOALS To understand the activity of programming To learn about the architecture of computers To learn about machine code.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
How to Execute TSR Program. Install Borland C++ Download Borland C++ from LMS – oads/BORLANDC.rarhttp://vulms.vu.edu.pk/Courses/CS609/Downl.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
3/5/2002e-business and Information Systems1 Java Java Java Virtual Machine (JVM) Java Application Program Interface (API) HW Kernel API Application Programs.
1 Mapping a Drive on a USF IIS Server. 2 Mapping a Drive To map a drive to a network file directory in Windows you must be on a Microsoft local area network,
1.1: Objects and Classes msklug.weebly.com. Agenda: Attendance Let’s get started What is Java? Work Time.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
1 Development Environments AUBG, COS dept Lecture Title: Dev Env: BlueJ (Extract from Syllabus) Reference:
1 Using an Integrated Development Environment. Integrated Development Environments An Integrated Development Environment, or IDE, permits you to edit,
Introduction to java (class and object). Programming languages: –Easier to understand than CPU instructions –Needs to be translated for the CPU to understand.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Author: Loh Jianxiong Christopher Contributions: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang, Tong Chun Kit, Tania Chattopadhyay.
CS210 Intermediate Computing with Data Structures (Java)
Eclipse.
Introduction to Java Import Scanner class to use in our program
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Programming without BlueJ Week 12
CompSci 230 Software Construction
Important terms Black-box testing White-box testing Regression testing
Important terms Black-box testing White-box testing Regression testing
How to Run a Java Program
How to Run a Java Program
How to Execute TSR Program
Java Programming with BlueJ Objectives
How to Execute TSR Program
Review of Previous Lesson
Presentation transcript:

EIE375 BlueJ: Getting Started Dr Lawrence Cheung

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 2 Login Login your computer in CF105, CF105a.  Username: student id. (e.g., D)  Password: your password After login, you will find there exists a network drive for your storage, i.e., Drive H. You should have a flash drive to save all your programs.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 3 BlueJ BlueJ is a Java programming development environment.  This software package that can help you to develop and test program codes.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 4 Installation Prerequisites: You must have J2SE v1.4 (JDK 1.4) or later installed on your system.  You can download it from Sun’s web site at  Download both “JRE” (Java Runtime Environment) and “SDK” (Software Development Kit) Downloading JRE only is not sufficient.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 5 Installation The distribution file for Windows systems is called bluejsetup-xxx.exe, where xxx is a version number.  Example: bluejsetup-200.exe represents version  You can download it from the BlueJ web site at

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 6 Getting Started Create a new project (a group of Java programs)  Select “New Project...” from the Project menu.  Click OK, and the new project is created and opened.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 7 Getting Started Create a new class  Select “New Class...” from the menu.  A dialog will appear to let you enter a name for the new class

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 8 Getting Started Edit a class  Right click the icon of the class and select “Open Editor”.  Or you simply double-click the icon.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 9 Getting Started Compile a project  Select “Compile” from the menu.  This function will always try to compile all un-compiled classes.  If errors are detected, each class with one or more errors is opened and the first error is displayed.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 10 Getting Started Compile a class  Right click the icon of the class and select “Compile”.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 11 Getting Started Create an object from a class  Right click the class and select a constructor for the class.  An object creation dialog will appear. This dialog may look like this:

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 12 Getting Started  In the name field, you have to enter a name for the object (or instance) to be created.  If the constructor has parameters, the dialog will also include fields to enter the parameters.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 13 Getting Started  Once the object is created, it will appear on the object bench.  The object icon shows its name and class. For example:

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 14 Getting Started Call a method  To call any method, you must first create an object first.  Then you can right click the object. A pop-up menu will list all methods of the object.  When a method is selected, it will execute and the result (if any) will be displayed in a separate window.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 15 Getting Started Call the main method  Right click the class icon and select “void main(String[] args)”

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 16 Program Execution without BlueJ You can run your java programs in Windows command prompt.  Open a Windows command prompt.  Move to the working directory.  Run by typing java.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 17 Debugging Set a breakpoint  Open a class and select “Set/Clear Breakpoint” from the Tools menu.  Or click in the tag bar and then click in that area will set a breakpoint at the selected position.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 18 Debugging  Once execution reaches the breakpoint, the machine will be interrupted, the source code currently executed will be shown and the debugger window will be opened automatically.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 19 Debugging  You can then use the “Step” or “Step Into” button to step through your code.  The current position in the code will be indicated by an arrow in the tag bar. Note: Step will execute the whole method and stop again at the next instruction after the method. Step Into will go into the method and stop at the first instruction within the method.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 20 First Java Program: “Hello World” Step 1: Create a new project then create a new class named “HelloWorld”. Step 2: Open a class then type in the following text: public class HelloWorld { private String name; public HelloWorld(String fullName) { name = fullName; }

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 21 First Java Program: “Hello World” public String getName() { return name; } public void print() { System.out.println(name); } public static void main(String[] args) { System.out.println("Hello, World!"); }

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 22 First Java Program: “Hello World” Step 3: Compile the program.  If you compiled your program successfully, you should have.class file under your project directory. Step 4: Execute the program.

EIE 375 BlueJ: Getting Started Hong Kong Polytechnic University 23 Reminder Each time when you start to work on a new tutorial exercise, assignment or mini- project, you should  Create a new project and,  Create a new.java file.

End