OOPR Lesson-1
OOPR Lesson-1
OOPR Lesson-1
❑ Introduction
❑ Graphical Input and Output with Option
Panes
❑ Using Input Dialog Boxes
❑ Using Confirm Dialog Boxes
Java Quick
Start Review
7
Welcome to Apache
NetBeans IDE!
Let’s start with the first set of slides
Reference: https://netbeans.apache.org/kb/docs/java/index.html
8
Overview
Project Name:
Printing University Vision & Mission
OLFUVM
Create a Java program
that displays the Class name:
VISION and MISSION lastname_firstname_
of the UNIVERSITY. W2L1
Introduction to
GUI Building
19
What is the
importance of
having a Graphical
User Interface?
20
GUI
GUI
JAVA GUI
Reference: https://docs.oracle.com/javase/tutorial/uiswing/start/about.html
23
JAVA GUI
JFC FEATURES
Feature Description
Includes everything from buttons to split panes to tables.
Swing GUI
Many components are capable of sorting, printing, and drag
Components
and drop, to name a few of the supported features.
The look and feel of Swing applications is pluggable, allowing a choice of look and feel. For example, the same
Pluggable Look-and-Feel program can use either the Java or the Windows look and feel. Additionally, the Java platform supports the GTK+
Support look and feel, which makes hundreds of existing look and feels available to Swing programs. Many more look-
and-feel packages are available from various sources.
Enables assistive technologies, such as screen readers and Braille displays, to get information from the user
Accessibility API
interface.
Enables developers to easily incorporate high-quality 2D graphics, text, and images in applications and applets.
Java 2D API
Java 2D includes extensive APIs for generating and sending high-quality output to printing devices.
Allows developers to build applications that can interact with users worldwide in their own languages and cultural
Internationalization conventions. With the input method framework developers can build applications that accept text in languages
that use thousands of different characters, such as Japanese, Chinese, or Korean.
Reference: https://docs.oracle.com/javase/tutorial/uiswing/start/about.html
Java AWT
26
Java AWT
Java Swing
Java Swing
Reference:https://www.javatpoint.com/java-swing
Graphical Input
and Output with
Option Panes
33
JOptionPane class
showMessageDialog()
EXAMPLE 1
Place your screenshot here Dialog displaying "Hello World!",
with OK button, standard "info"
icon, and title "Message".
JOptionPane.showMessageDialog(null, "Hello!");
37
showMessageDialog()
EXAMPLE 2
Dialog displaying "Hello!", with
OK button, no standard icon,
and title “Sample ONLY".
Message Types
messageType
Defines the style of the message. The Look and Feel manager may lay
out the dialog differently depending on this value, and will often provide
a default icon. The possible values are:
ERROR_MESSAGE
INFORMATION_MESSAGE
WARNING_MESSAGE
QUESTION_MESSAGE
PLAIN_MESSAGE
39
showInputDialog()
EXAMPLE 3
Dialog with empty text field,
"Enter value:" prompt string,
plus OK and CANCEL
Place your screenshot here
buttons.
showconfirmDialog()
EXAMPLE 4
Dialog displaying "Hello!” with
YES+NO+CANCEL buttons,
standard "question mark" icon,
and title "Select an Option“
Option Types
optionType
Defines the set of option buttons that appear at the
bottom of the dialog box:
DEFAULT_OPTION
YES_NO_OPTION
YES_NO_CANCEL_OPTION
OK_CANCEL_OPTION
Week 2: Laboratory Exercise 2
30 POINTS
Week 2: Laboratory Exercise 2
▸ Orange #ff8700
You don’t need to keep this slide in your presentation. It’s only here to serve you as a design guide if you need to
create new slides or download the fonts to edit the presentation in PowerPoint®