From BlueJ to NetBeans SWC 2.semester.

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

1 eclipse Tips. 2 What is eclipse? Eclipse is a popular IDE (Integrated Development Environment) that we will use to create, compile, execute, and test.
BlueJ: a very quick introduction. BlueJ BlueJ is an IDE (Interactive Development Environment). It includes –an editor, which you use to write your programs.
Java Tutorial – Building GUIs Java with Added Swing Daniel Bryant
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.
Using Java without BlueJ Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling BlueJ projects A BlueJ.
Introduction to Java A lab course by Dr. Junaid Ahmed Zubairi SUNY Fredonia.
Unit2: Object-oriented programming Getting started with Java Jin Sa.
C# Programming: From Problem Analysis to Program Design1 2 Your First C# Program.
CS1020: Intro Workshop. Topics CS1020Intro Workshop Login to UNIX operating system 2. …………………………………… 3. …………………………………… 4. …………………………………… 5. ……………………………………
13-Jul-15 BlueJ: A Very Quick Introduction. BlueJ BlueJ is an IDE (Integrated Development Environment). It includes an editor, which you use to write.
PHY281Introduction to JavaSlide 1 Introduction to Java In this section we will learn how how to use Java and write our first Java Applet:  The Java Development.
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.
Unit 2: Java Introduction to Programming 2.1 Initial Example.
Week 2 - Friday.  What did we talk about last time?  Data representation  Binary numbers  Types  int  boolean  double  char  String.
1 eclipse Tips. 2 What is eclipse? Eclipse is a popular IDE (Integrated Development Environment) that we will use to create, compile, execute, and test.
The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.
Integrated Development Environments (IDEs) CS 21a: Introduction to Computing I First Semester,
Using Eclipse. What is Eclipse? The Eclipse Platform is an open source IDE (Integrated Development Environment), created by IBM for developing Java programs.
Karel J Robot An introduction to BlueJ and Object- Oriented Programming.
Week 1 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
1 Introduction to Java Brief history of Java Sample Java Program Compiling & Executing Reading: => Section 1.1.
UCSC All rights reserved. No part of this material may be reproduced and sold. 1 IT1202-Fundamentals Of Programming (Using JAVA) Interacting with.
© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures for Java William H. Ford William R. Topp Appendix E The EZJava.
OOP (Java): Simple/ OOP (Java) Objectives – –give some simple examples of Java applications and one applet 2. Simple Java Programs Semester.
Lecture 2: Classes and Objects, using Scanner and String.
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
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.
Input & Output In Java. Input & Output It is very complicated for a computer to show how information is processed. Although a computer is very good at.
NetBeans IDE 程序设计 B 班 Outline What is NetBeans? Developing General Java Applications Creating GUI for an application Debugging with NetBeans.
Comments in Java. When you create a New Project in NetBeans, you'll notice that some text is greyed out, with lots of slashes and asterisks:
First Programs CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Programming Fundamentals 2: Simple/ F II Objectives – –give some simple examples of Java applications and one applet 2. Simple Java.
EIE375 BlueJ: Getting Started Dr Lawrence Cheung.
1 CSC 222: Object-Oriented Programming Spring 2012 netBeans & GUIBuilder  netBeans IDE create/edit/run a project  GUIBuilder JFrame, JButton, JTextField,
29-Nov-15 Getting Ready for Java. 2 What is Java? Java is a programming language: a language that you can learn to write, and the computer can be made.
22-July-2002cse142-13B-Development © 2002 University of Washington1 Development Tools CSE 142, Summer 2002 Computer Programming 1
Introduction Chapter 1 8/31 & 9/1 Imagine! Java: Programming Concepts in Context by Frank M. Carrano, (c) Pearson Education - Prentice Hall, 2010.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
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.
Introduction to array: why use arrays ?. Motivational example Problem: Write a program that reads in and stores away 5 double numbers After reading in.
Martin T. Press.  Main Method and Class Name  Printing To Screen  Scanner.
import java.util.Scanner; class myCode { public static void main(String[] args) { Scanner input= new Scanner(System.in); int num1; System.out.println(“Enter.
CS 115 OBJECT ORIENTED PROGRAMMING I LECTURE 6_1 GEORGE KOUTSOGIANNAKIS Copyright: FALL 2015 Illinois Institute of Technology- George Koutsogiannakis 1.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
1 Development Environments AUBG, COS dept Lecture Title: Dev Env: NetBeans (Extract from Syllabus) Reference:
Introduction to programming in java
1 Development Environments AUBG, COS dept Lecture Title: Dev Env: BlueJ (Extract from Syllabus) Reference:
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
CS 201 Lecture 7: John Hurley Summer 2012 Cal State LA.
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Compiling and Running a Java Program
Eclipse Navigation & Usage.
Programming without BlueJ Week 12
Something about Java Introduction to Problem Solving and Programming 1.
String Output ICS 111: Introduction to Computer Science I
How to Run a Java Program
How to Run a Java Program
BlueJ: a very quick introduction
Constructors, GUI’s(Using Swing) and ActionListner
Introduction to Java Brief history of Java Sample Java Program
Using Eclipse.
Running a Java Program using Blue Jay.
Random Numbers while loop
Workshop for Programming And Systems Management Teachers
Presentation transcript:

From BlueJ to NetBeans SWC 2.semester

Why change…? BlueJ is great for introduction to programming Simple interface, few options Graphical interface to classes and objects Some tehnical details are hidden

Why change…? NetBeans is great for professional programming Much more functionality Better editor, debugger,… Integration to database systems A full-blown, stand-alone system …but also more complex!

What is NetBeans? NetBeans is an open-source project Originates from SUN Microsystems www.netbeans.org Can - of course – be downloaded for free from the website We use NetBeans 6.9.1 SE (+ Java JDK)

What is NetBeans?

How do I… …create a new project? …add a new class? …edit a class definition? …write text to the screen? …get input from the user? …run a project?

Create a new project - BlueJ Choose Project | New Project…

Create a new project - BlueJ Enter project name, press ”Create”

Create a new project - NetBeans Choose File | New Project…

Create a new project - NetBeans In Categories, choose ”Java” In Projects, choose ”Java Application”

Create a new project - NetBeans Enter project name and location

Create a new project - NetBeans

Create a new project - NetBeans Why is there a ”Main.java” class…? All Java programs must contain a method with this signature: public static void main(String[] args) This was hidden in BlueJ! Think of Main as a ”System” class When the program starts, the code in the main(…) method is executed

Add a new class- BlueJ Press ”New Class…” Enter class name

Add a new class- BlueJ

Add a new class- NetBeans Highlight the bankaccount package! Choose New | Java Class

Add a new class- NetBeans Enter class name

Add a new class- NetBeans

Edit a class definition - BlueJ Double-click on the class icon

Edit a class definition - BlueJ

Edit a class definition - NetBeans Double-click on the class icon

Edit a class definition - NetBeans Note the file panes in NetBeans

Edit a class definition - NetBeans Why do red lines start to appear in the code, as soon as I start typing…? The NetBeans editor continuously makes an analysis of the code, even before it is compiled The editor highlights errors in the code by a waved red line, even before typing has been completed Helpful…? Annoying…?

Edit a class definition - NetBeans Yes, I know, but I am still typing!!

Edit a class definition - NetBeans See hints by hovering mouse over (!)

Edit a class definition - NetBeans Why do lists with method names pop up when I type…? The NetBeans editor supports ”auto- completion”, i.e. it tries to predict what you will type next Typically when calling a method with ”.” Helpful, when you get used to it…

Edit a class definition - NetBeans Available methods on the specific object/class Documentation for each method

Writing text to the screen - BlueJ

Writing text to the screen - BlueJ

Writing text to the screen - NetBeans

Writing text to the screen - NetBeans Need this code for actually executing the method

Writing text to the screen - NetBeans Output written to the ”Output window”

Get input from the user - BlueJ

Get input from the user - BlueJ Enter parameter value directly

Get input from the user - NetBeans Not quite as simple to get input from a user in NetBeans Two options Use the Scanner class Use a input dialog class See chapter 3.6 in Big Java for details

Get input from the user - NetBeans import java.util.Scanner; … Scanner in = new Scanner(System.in); String name = in.nextLine(); int balance = in.nextInt(); double area = in.nextDouble();

Get input from the user - NetBeans import javax.swing.JOptionPane; … String value = JOptionPane.showInputDialog(”Limit”); int limit = Int.parseInt(value);

Running a project - BlueJ We cannot as such ”run” a project in BlueJ – what should run..? We usually create a ”system” class, that has a ”run”-like method Create a System object Right-click the object Call the run method

Running a project - NetBeans Choose Run | Run Main Project

Running a project - NetBeans …or just click the green triangle (or press F6)

Running a project - NetBeans Running a project always executes the main method in the Main class! A project is automatically compiled when you save it No reason to run a project in order to fix syntax errors

Other NetBeans features A GUI Builder – build a GUI by drag-drop of controls. Code is auto-generated A much more powerful debugger More customisable Easy integration to database systems We will talk about additional features later on…