GUI Applications ButtonGroup and JRadioButton. Contents A.Problem: The Metric Converter Application B.Solution C.Exercise: Moving all calculations into.

Slides:



Advertisements
Similar presentations
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Advertisements

Lecture 15 Graphical User Interfaces (GUI’s). Objectives Provide a general set of concepts for GUI’s Layout manager GUI components GUI Design Guidelines.
Writing GUI Applications An introduction with Java.
Graphical User Interfaces
10.1 AWT The AWT classes Users today expect a Graphical User Interface (GUI) Improves application usability Difficult to implement cross-platform.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
1 Class 8. 2 Chapter Objectives Use Swing components to build the GUI for a Swing program Implement an ActionListener to handle events Add interface components.
Metric and Non-Metric Conversion Problems.
Chapter 6: Graphical User Interface (GUI) and Object-Oriented Design (OOD) J ava P rogramming: Program Design Including Data Structures Program Design.
EXAM 1 Study Aids or… Think, Multiply, Divide, Conquer.
Java Programming Chapter 10 Graphical User Interfaces.
Event-driven Programming
JLabel, JTextField, JButton and JOptionPane
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,
GUI Applications JCheckBox
CSEB114: Principle of programming
3461A Readings from the Swing Tutorial. 3461A Overview  The follow is the Table of Contents from the trail “Creating a GUI with JFC/Swing” in the “The.
Unit 22 Linear Measurement.
Unit Conversions Q - How many kilometers are in 47 miles? (note: 1 km = miles) First identify the desired quantity. # km.
MEASUREMENT. Chapter One: Measurement  1.1 Measurements  1.2 Time and Distance  1.3 Converting Measurements  1.4 Working with Measurements.
Dimensional Analysis or Unit Analysis
A First Look at GUI Applications Part IV: Radio Buttons 1.
Ch 3-4: GUI Basics Java Software Solutions Foundations of Program Design Sixth Edition by Lewis & Loftus Coming up: GUI Components.
UNITS OF MEASUREMENT Using and Converting. Introduction ■Scientists use the International System of Units (SI), which is an extension of the metric system.
ITEC 109 Lecture 27 GUI Interaction. Review GUI basics JFrame JPanel JLabel, JButton, JTextField Layout managers –Flow / Box –Border / Grid.
 Fold and cut paper as instructed  Label each section  Rectangle  Triangle  Trapezoid  Circle  Write formulas for perimeter and area under each.
Interactive Programs Java API. Terminology Event—an action or occurrence, not part of a program, detected by the program. Events can be Event—an action.
Topics Introduction Scene Graphs
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Creating Applets. What is an applet? What is an applet? A Java program that runs in a web browser. A Java program that runs in a web browser. An applet.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 41 JavaServer Face.
Multiple Unit Multipliers Conversion of Units of Area
GUI Programming Joseph Sant Sheridan College. Agenda Elements of GUI programming Component-Based Programming. Event-Based Programming. A process using.
Java Programming: From Problem Analysis to Program Design, 3e Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Java Programming: From Problem Analysis to Program Design, Second Edition1 Lecture 5 Objectives  Learn about basic GUI components.  Explore how the GUI.
Java Programming, Second Edition Chapter Thirteen Understanding Swing Components.
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
5.7 CONVERTING UNITS LO: CONVERT BETWEEN METRIC AND IMPERIAL UNITS OF MEASURE.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
Swing GUI Components So far, we have written GUI applications which can ‘ draw ’. These applications are simple, yet typical of all Java GUI applications.
Event Handler Methods Text field Object Responder JAVA AWT Environment: Messages are sent between JAVA Objects Screen Event Notification Press Button.
Chapter 1.3 Conversion Factors and Unit Cancellation.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
X = Unit you want to change Unit you are changing into Conversion Factor 1.Start with the unit you want to change. 2.Multiply it by a blank fraction. 3.The.
Unit Conversions. A physical quantity must include: Number + Unit.
CIS 270—Application Development II Chapter 11—GUI Components: Part I.
Unit 8-1 Units of Measure and conversionsUnits of Measure and conversions.
Sunday – 1 August  How to create new mobile device application project  How to compile and package mobile device project, and make it installable.
Unit you are changing into
A First Look at GUI Applications Radio Buttons and Check Boxes
Unit 2: Lesson 1 Unit Conversions
Draw the cardinal and intermediate direction
A First Look at GUI Applications
Advanced User Interfaces
Chapter Topics 15.1 Graphical User Interfaces
Processing Timer Events
Graphical User Interface (pronounced "gooey")
Graphical user interface with Swing by jose maria gonzalez pinto
Java Programming: From Problem Analysis to Program Design,
Tooltip -Radio Button.
Chapter 15: GUI Applications & Event-Driven Programming
Constructors, GUI’s(Using Swing) and ActionListner
Unit Analysis.
Aim: To be able to convert Kg’s to llbs and Km to miles.
Unit Conversions “Using Dimensional Analysis”
MAP4C Unit 2 Measurement in Design.
TA: Nouf Al-Harbi NoufNaief.net :::
Miles to Kilometers problem
TA: Nouf Al-Harbi NoufNaief.net :::
Presentation transcript:

GUI Applications ButtonGroup and JRadioButton

Contents A.Problem: The Metric Converter Application B.Solution C.Exercise: Moving all calculations into a separate class

A. Problem: The Metric Converter App Develop a GUI that allows the user to enter a distance in kilometers, and then click on radio buttons to see that distance converted to miles, feet, or inches The conversion formulas are Miles = Kilometers  Feet = Kilometers  Inches = Kilometers 

B. Solution 1.Developing the View 2.Developing test cases 3.Implementing event handlers for the radio buttons

1. Developing the View Project name: Metric Converter Class name: MetricConverterView Package: metricconverter Frame title: Metric Converter GUI components –The Km panel 1 Label 1 Text field –The button panel 1 Button group 3 radio buttons

2. Developing test cases 2 kilometers = miles = feet = inches

3. Implementing event handlers for the radio buttons

C. Exercise: Moving all calculations into a separate class

The View & Controller

The Model

References 1.GUI Building in NetBeans IDE tart-gui.html tart-gui.html 2.Starting Out With Java 5 from control structures to objects. Tony Gaddis