CSC 222: Object-Oriented Programming

Slides:



Advertisements
Similar presentations
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Advertisements

Java Graphical User Interface (GUI) using Visual Editor in eclipse CSI 1390 – Java Programming Instructor: Saeid Nourian University.
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
CS320n –Visual Programming LabVIEW Foundations. Visual ProgrammingLabVIEW Foundations2 What We Will Do Today Hand back and review the midterm Look at.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
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.
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.
Starting Chapter 4 Starting. 1 Course Outline* Covered in first half until Dr. Li takes over. JAVA and OO: Review what is Object Oriented Programming.
From BlueJ to NetBeans SWC 2.semester.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
IE 411/511: Visual Programming for Industrial Applications
Using the Netbeans GUI Builder. The Netbeans IDE provides a utility called the GUI Builder that assists you with creating Windows applications. The Netbeans.
1 Object-Oriented Software Engineering CS GUI building with NetBeans Contents User Interaction JButtons JTextFields JLabels JForms in NetBeans Practical.
SIMPLE PROBLEM SOLVING in Java: a Problem Set Framework Viera K. Proulx Richard Rasala Jason Jay Rodrigues CCSCNE 2002 Conference.
CHAPTER TWO INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
1 CSC 222: Object-Oriented Programming Spring 2012 netBeans & GUIBuilder  netBeans IDE create/edit/run a project  GUIBuilder JFrame, JButton, JTextField,
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.
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.
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.
Intoduction to Andriod studio Environment With a hello world program.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
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.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Dive Into® Visual Basic 2010 Express
CSC 222: Object-Oriented Programming
Java FX: Scene Builder.
CSC 222: Object-Oriented Programming
CST 1101 Problem Solving Using Computers
Chapter 2: The Visual Studio .NET Development Environment
CSC 222: Object-Oriented Programming Spring 2017
INF230 Basics in C# Programming
Development with Eclipse
Working in the Forms Developer Environment
Graphical User Interface in MATLAB
Chapter Topics 15.1 Graphical User Interfaces
Chapter 2 – Introduction to the Visual Studio .NET IDE
Console and GUI Programs
Lecture 27 Creating Custom GUIs
1. Introduction to Visual Basic
Chapter 2 First Java Programs
Ellen Walker Hiram College
Chap 7. Building Java Graphical User Interfaces
Graphical User Interfaces -- Introduction
User Interface Software Look under the hood
VISUAL BASIC.
Social Media And Global Computing Introduction to Visual Studio
Chapter 2 – Introduction to the Visual Studio .NET IDE
Hands-on Introduction to Visual Basic .NET
Understanding the Visual IDE
CIS16 Application Development Programming with Visual Basic
GRAPHICAL USER INTERFACE
Chapter 15: GUI Applications & Event-Driven Programming
Constructors, GUI’s(Using Swing) and ActionListner
Java Programming with BlueJ Objectives
Object-Oriented PHP (1)
Presentation transcript:

CSC 222: Object-Oriented Programming Fall 2015 Object-oriented design OO design review objects, cohesion, loose coupling, polymorphism, … Model-View-Controller (MVC) pattern netBeans IDE create/edit/run a project, advanced features GUIBuilder, Swing GUI toolkit

Object-oriented development OO design is the dominant approach to large-scale software development developing cohesive (& loosely coupled) software objects allows for independent teams to contribute independent testing & debugging easier code reuse polymorphism via interfaces allows for independent development (interface serves as contract) generic code that can work on entire hierarchies of classes polymorphism via inheritance allows for code reuse (can extend existing code without direct access)

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.org

Create a project

Select location & project name

Adding a file to the project

Select location & file/class name

Can then edit the default file

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

Editor features code completion when type OBJECT., see list of method options Source menu Format will try to indent selected lines consistently Shift Left / Shift Right will manually indent selected lines Toggle Comment comments/uncomments selected lines Refactor Rename can change a class/variable/method name throughout the project Run Build Main Project compile all classes in the project Run Main Project execute the main method note: can also right-click on a file and select Run File

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" define a new class named TerminalUI, in the main method prompt the user for a question call getAnswer and display the answer

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)

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

Naming the GUI class

GUI design view

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)

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

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

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

Wumpus GUI we could similarly define a GUI for Hunt the Wumpus Model: CaveContents + Cave + CaveMaze (note: no I/O in these classes) View: window with text area (for output) and buttons (for input) Controller: JFrame that connects GUI elements with CaveMaze model