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.

Slides:



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

Graphical User Interfaces
Graphical User Interfaces (Part IV)
Java Software Development Paradigm Lecture # 12. Basics of GUI.
CS18000: Problem Solving and Object-Oriented Programming.
Unit 3 Graphical User Interface (GUI) Dr. Magdi AMER.
Graphic User Interfaces Layout Managers Event Handling.
Corresponds with Chapter 12
Fall 2007CS 225 Graphical User Interfaces Event Handling Appendix C.
Java Swing Recitation – 11/(20,21)/2008 CS 180 Department of Computer Science, Purdue University.
Java Swing Toolkit Graphics The key to effectively using graphics in Java is understanding: –the basic components of the graphics library –the patterns.
Swinging Into Swing Leo S. Primero III. Understanding what Swing Is Swing is a package that lets you create applications that use a flashy Graphical User.
Graphical User Interfaces (GUIs) GUI: An application that uses graphical objects to interact with users GUI applications consist of: –Events: A user or.
Scott Grissom, copyright 2006Ch 11: GUI Slide 1 Graphical User Interfaces (Ch 11) Careful design of a graphical user interface is key to a viable software.
CPSC150 Week 12 Graphical User Interfaces Chapter 11.
Contructing GUI’s in Java Implemented in the Swing API Imported into your programs by: import javax.swing.*; Most Swing programs also need the AWT packages.
Chapter 8: Graphical User Interfaces Objectives - by the end of this chapter, you should be able to do the following: –write a simple graphical user interface.
Java Programming Chapter 10 Graphical User Interfaces.
1 Event Driven Programming wirh Graphical User Interfaces (GUIs) A Crash Course © Rick Mercer.
Using the Netbeans GUI Builder. The Netbeans IDE provides a utility called the GUI Builder that assists you with creating Windows applications. The Netbeans.
CIS 068 Welcome to CIS 083 ! Introduction to GUIs: JAVA Swing.
1 CSC111H Graphical User Interfaces (GUIs) Introduction GUIs in Java Understanding Events A Simple Application The Containment Hierarchy Layout Managers.
Applets and Frames CS 21a: Introduction to Computing I First Semester,
Introduction to GUI in Java 1. Graphical User Interface Java is equipped with many powerful,easy to use GUI component such as input and output dialog.
CHAPTER:06 JAVA IDE PROGRAMMING-I Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
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.
Introduction to Swing Components Chapter 14.  Part of the Java Foundation Classes (JFC)  Provides a rich set of GUI components  Used to create a Java.
Java Programming: Advanced Topics 1 Common Elements of Graphical User Interfaces Chapter 6.
 2002 Prentice Hall, Inc. All rights reserved Introduction Graphical User Interface (GUI) –Gives program distinctive “look” and “feel” –Provides.
1 Outline 1 Introduction 2 Overview of Swing Components 3 JLabel 4 Event Handling 5 TextFields 6 How Event Handling Works 7 JButton 8 JCheckBox and JRadioButton.
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
Graphics and Event-Driven Programming in Java John C. Ramirez Department of Computer Science University of Pittsburgh.
MSc Workshop - © S. Kamin, U. ReddyLect 3 - GUI -1 Lecture 3 - Graphical User Interfaces r GUI toolkits in Java API r JFrame r GUI components.
Timer class and inner classes. Processing timer events Timer is part of javax.swing helps manage activity over time Use it to set up a timer to generate.
Chapter 12 1 TOPIC 13B l Buttons and Action Listeners Window Interfaces Using Swing Objects.
Object Oriented programming Instructor: Dr. Essam H. Houssein.
Object Oriented Programming Engr. M. Fahad Khan Lecturer, Software Engineering Department University of Engineering & Technology, Taxila.
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.
CS Fall 2012, Lab 09 Haohan Zhu. Boston University Slideshow Title Goes Here CS Fall 2012, Lab /20/2015 GUI - Graphical User Interface.
1 / 67 COP 3503 FALL 2012 SHAYAN JAVED LECTURE 14 Programming Fundamentals using Java 1.
The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include: a rich set of user interface components; a.
CS1054: Lecture 21 - Graphical User Interface. Graphical User Interfaces vs. Text User Interface.
Java GUI. Graphical User Interface (GUI) a list a button a text field a label combo box checkbox.
CS 4244: Internet Programming User Interface Programming in Java 1.0.
SEEM3460 Tutorial GUI in Java. Some Basic GUI Terms Component (Control in some languages) the basic GUI unit something visible something that user can.
Introduction to GUI in 1 Graphical User Interface 2 Nouf Almunyif.
Review_6 AWT, Swing, ActionListener, and Graphics.
1 Chapter 16: Creating Windows. 2 Basics of GUI Programming How to create a Window. TryWindow.java You always need a JFrame component before creating.
Creating a Window. A basic window in Java is represented by an object of the class Window in the package java.awt.
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
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.
Graphical User Interface (GUI)
User Interface Components. Layout Placement of UI components in a window – Size & Position Each component occupies a rectangular region in the window.
Developing GUIs With the Eclipse Visual Editor, Swing/AWT Edition David Gallardo.
Introduction to GUI Programming in Java: Frames, Simple Components, and Layouts.
CIS 270—Application Development II Chapter 11—GUI Components: Part I.
Java Programming Fifth Edition Chapter 13 Introduction to Swing Components.
GUIs & Event-Driven Programming Chapter 11 Review.
Introduction to Swing Mr. Crone. What is Swing? a collection of pre-made Java classes used to create a modern graphical user interface.
GUI.1 Graphical User Interfaces GUIs. GUI.2 The Plan Components Flat Layouts Hierarchical Layouts Designing a GUI Coding a GUI.
A Quick Java Swing Tutorial
Christopher Budo, Davis Nygren, spencer franks, Luke miller
A First Look at GUI Applications
Java GUI.
Java Swing.
Graphical User Interface (pronounced "gooey")
Ellen Walker Hiram College
Steps to Creating a GUI Interface
Graphical User Interface
Presentation transcript:

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 with text, to interact with user. In Java, GUI Programming is done through Swing API. The Swing toolkit, includes a rich set of graphical components for building GUIs.

Ajmer Singh PGT(IP) Types of Swing Components 1.Components : A Swing Component is a self contained entity that can be customized and inserted into application. e.g JLabel, JTextField, Jbutton, JCheckBox etc. 2.Containers : A container is a special type component that can hold other components. e.g. Jpanel, JFrame etc.

Ajmer Singh PGT(IP) Component It ia an object that defines a screen element such as a button, textfield, scroll bar, menu etc.

Ajmer Singh PGT(IP) Types of Containers Top Level Containers: It can be used directly. Top Level Containers: It can be used directly. Non-Top Level Containers: It requires another Top Level Container for its use. Non-Top Level Containers: It requires another Top Level Container for its use.

Ajmer Singh PGT(IP) Layout Managers Layout Managers enable to control the ways in which visual components are arranged in GUI forms by determining the size and position of components within containers. Different Layout Managers are FlowLayout, GridLayout, CardLayout, SpringLayout, BorderLayout, GridBagLayout, BoxLayout

Ajmer Singh PGT(IP) Frame It is a top-level window with a title and border.

Ajmer Singh PGT(IP) COMMONLY USED PROPERTY OF FRAME  title: It sets the title of the frame which is displayed on the title bar of the frame.

Ajmer Singh PGT(IP) Panel It is a type of container that’s designed to hold a group of components so they can be displayed on the frame.

Ajmer Singh PGT(IP) Adding components to Panel  Click Panel under the Swing Container section of the Palette and drag and drop over the frame.  Select the other components from the palette that you want to add to the panel and drag and drop over the panel.

Ajmer Singh PGT(IP) COMMONLY USED PROPERTIES OF PANEL  background: It sets the background color of the Panel.  border: It lets you specify the type of border that will surround the Panel.

Ajmer Singh PGT(IP) WORKING WITH BUTTONS

Ajmer Singh PGT(IP) PUSH BUTTONS OR SIMPLY BUTTONS Buttons are action components i.e., these can be programmed for action. When user clicks on a button during runtime corresponding action takes place. It is created through JButton class of Swing API.

Ajmer Singh PGT(IP) COMMONLY USED PROPERTIES OF BUTTON  background: It sets the background color of the button.  border: It lets you specify the type of border that will surround the button.  font: It sets the font for the text of the button.  foreground: It sets the foreground color of the button.

Ajmer Singh PGT(IP) COMMONLY USED PROPERTIES OF BUTTON  text: It sets the text of the button.  enabled: This property determines whether the button is active or not.  mnemonic: It lets you specify the shortcut key or the access key for the button that you can combine with Alt to invoke the button during runtime.

Ajmer Singh PGT(IP) COMMONLY USED METHODS OF BUTTON void setText(String): It sets the text displayed by the button to the String value specified in parenthesis. String getText(): It returns the text displayed by the button. void setSelected(boolean): Sets the button to appear as selected. boolean isSelected(): It returns the state whether the button is selected or not.

Ajmer Singh PGT(IP) MOST COMMON EVENTS OF BUTTON The most common event is Action Event which is handled by the actionPerformed method of event listener ActionListener.

Ajmer Singh PGT(IP) Creating an EXIT button EXIT button is used to close an application. To create an EXIT button you need to perform the following steps: 1.Add a Button to your application. 2.Set its text property to “Exit”. 3.Type the following code to actionPerformed() method. Sytem.exit(0);