1 CSC 222: Object-Oriented Programming Spring 2012 netBeans & GUIBuilder  netBeans IDE create/edit/run a project  GUIBuilder JFrame, JButton, JTextField,

Slides:



Advertisements
Similar presentations
Java Graphical User Interface (GUI) using Visual Editor in eclipse CSI 1390 – Java Programming Instructor: Saeid Nourian University.
Advertisements

Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Event Driven Programming and GUIs Part 3 CS221 – 4/15/09.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Object-Oriented Analysis and Design
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Chapter 7 Improving the User Interface
Eclipse IDE. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as teaching.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
From BlueJ to NetBeans SWC 2.semester.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Introduction to Matlab & Data Analysis
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Intro to GUIs (Graphical User Interfaces) Section 2.5Intro. to GUIs: a GUI Greeter Section 3.7Graphical/Internet Java: Einstein's Equation.
Using the Netbeans GUI Builder. The Netbeans IDE provides a utility called the GUI Builder that assists you with creating Windows applications. The Netbeans.
Java Programming: From Problem Analysis to Program Design, Second Edition1  Learn about basic GUI components.  Explore how the GUI components JFrame,
Chapter 3: Using GUI Objects and the Visual Studio IDE.
Applets and Frames CS 21a: Introduction to Computing I First Semester,
1 Object-Oriented Software Engineering CS GUI building with NetBeans Contents User Interaction JButtons JTextFields JLabels JForms in NetBeans Practical.
Introduction It is developed to create software applications. It is a tool for developers of any program that uses both basic and expert settings. It.
Copyright © Curt Hill First Window Builder Program Easy GUIs in Eclipse.
Introduction to Windows Programming
CHAPTER TWO INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
Chapter 9: Visual Programming Basics Object-Oriented Program Development Using Java: A Class-Centered Approach.
1 CSC111H Graphical User Interfaces (GUIs) Introduction GUIs in Java Understanding Events A Simple Application The Containment Hierarchy Layout Managers.
Graphics and Event-Driven Programming in Java John C. Ramirez Department of Computer Science University of Pittsburgh.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
An Introduction to Programming and Object Oriented Design using Java 3 rd Edition. Dec 2007 Jaime Niño Frederick Hosch Chapter 18 Integrating user interface.
Chapter 2 – Introduction to the Visual Studio .NET IDE
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Applets and Frames. Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved L14: GUI Slide 2 Applets Usually.
GUI Programming using NetBeans. RHS – SOC 2 GUI construction We have previously talked about elements in a (simple) GUI –Frames, Panes and Dialogs –Text.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
1 / 67 COP 3503 FALL 2012 SHAYAN JAVED LECTURE 14 Programming Fundamentals using Java 1.
Model View Controller MVC Web Software Architecture.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Java Beans. Definitions A reusable software component that can be manipulated visually in a ‘builder tool’. (from JavaBean Specification) The JavaBeans.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
CIS Intro to JAVA Lecture Notes Set 8 9-June-05.
Ajmer Singh PGT(IP) JAVA IDE Programming - I. Ajmer Singh PGT(IP) GUI (Graphical User Interface) It is an interface that uses a graphic entities along.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Lecture 33: More Graphical User Interface (GUI) Announcements & Review Read Ch GU1 & GU2 Cohoon & Davidson Ch 14 Reges & Stepp Lab 10 set game due 4/26.
Java - hello world example public class HelloWorld { public static void main (String args[]) { System.out.println("Hello World"); }
User Interface Programming in C#: Basics and Events Chris North CS 3724: HCI.
Swing GUI Components So far, we have written GUI applications which can ‘ draw ’. These applications are simple, yet typical of all Java GUI applications.
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
CIS 270—Application Development II Chapter 11—GUI Components: Part I.
1 Development Environments AUBG, COS dept Lecture Title: Dev Env: NetBeans (Extract from Syllabus) Reference:
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
CSC 222: Object-Oriented Programming
Chapter 2: The Visual Studio .NET Development Environment
Chapter 2 – Introduction to the Visual Studio .NET IDE
Lecture 27 Creating Custom GUIs
Ellen Walker Hiram College
Chap 7. Building Java Graphical User Interfaces
Graphical User Interfaces -- Introduction
Chapter 2 – Introduction to the Visual Studio .NET IDE
CIS16 Application Development Programming with Visual Basic
Chapter 15: GUI Applications & Event-Driven Programming
Presentation transcript:

1 CSC 222: Object-Oriented Programming Spring 2012 netBeans & GUIBuilder  netBeans IDE create/edit/run a project  GUIBuilder JFrame, JButton, JTextField, JTextArea, … model-view-control pattern

2 BlueJ  netBeans BlueJ is an Interactive Development Environment (IDE) designed for novice programmers  simple to use  visual interface makes class vs. object distinction clear  can directly manipulate objects & call methods using mouse clicks  can also write and execute statements in the Code Pad however, it is somewhat limiting to experienced programmers netBeans is a popular, industry-strength IDE for developing software  free & open-source  multi-platform (Mac, Windows, Linux)  multi-language (Java, PHP, C/C++, …)  has an integrated GUI builder  download from netbeans.orgnetbeans.org

Create a project 3

Select location & project name 4

Adding a file to the project 5

Select location & file/class name 6

Can then edit the default file 7

Completing a project each class in the project is its own file  one class must have a public static void main method  when you run the project, this main method is executed 8

Editor features code completion when type OBJECT., see list of method options Source menu Formatwill try to indent selected lines consistently Shift Left / Shift Rightwill manually indent selected lines Toggle Commentcomments/uncomments selected lines Refactor  Renamecan change a class/variable/method name throughout the project Run  Build Main Projectcompile all classes in the project  Run Main Projectexecute the main method 9

example: Magic 8-ball create a new project named Magic  use the default option to create a default main class named TerminalUI download the Die.java class into the src folder of this project define a new class named Magic8Ball  has a 3-sided Die object as a field  has a getAnswer method that takes a String as input (a question) and returns one of 3 possible answers at random: "Definitely", "No way", or "Outlook hazy" in the main method of the TerminalUI class,  prompt the user for a question  call getAnswer and display the answer 10

MVC pattern model-view-controller is a software pattern used to develop reusable, modular software  goal: isolate the application-specific logic from the user interface  allows for independent testing & development, easy updates for this example:  the model consists of the logic of the application – Die & Magic8Ball  the view is the Java terminal window  the controller is the TerminalUI class with its text-based input/output  by separating the logic from the interface, it makes it possible to plug in a different interface, e.g., a Graphical User Interface (GUI) 11

GUIBuilder netBeans has an integrated GUI builder built-in  can create a (Swing) GUI using a drag-and-drop interface 12

Naming the GUI class 13

GUI design view 14

Build interface drag GUI elements from the Palette onto the Design Frame  can arrange, resize, alter Properties of the elements  in particular, right click and change names of elements to be meaningful (e.g., questionArea, answerButton, answerBox) 15

Associate events with elements 16 right click on element, select the event you want to handle

Source view click on the Source button to see the generated code 17

Completing the GUI add the Controller code to the GUI class  here, Magic8Ball object is a field, initialized in constructor  code for I/O & method call are entered into the event-handler method 18