Gui in java

12
GUI in Java HALDIA INSTITUTE OF TECHNOLOGY A presentation on Presented by: GAURAV RAJ Roll no: 14/CS/33 Date: 02/03/2017

Transcript of Gui in java

Page 1: Gui in java

GUI in Java

HALDIA INSTITUTE OF TECHNOLOGY

A presentation on

Presented by: GAURAV RAJ Roll no: 14/CS/33 Date: 02/03/2017

Page 2: Gui in java

What is GUI ?

Page 3: Gui in java

GUI is an abbreviation for Graphical User Interface.

It is an interface that allows user to communicate with programs through graphical icons with some visual effects.

It is helpful in getting rid of those text-based interfaces used to perform various tasks.

Definition

Page 4: Gui in java

An example of text-based interface

An example of GUI

• Choosing Windows over other operating systems is a result of better GUI provided by the respective company.

Text – based interface Vs GUI

Page 5: Gui in java

Examples of GUI

Page 6: Gui in java

Terms in GUI

User interface components Content Pane Frame Layout Manager Panel Event - Driven programming

Page 7: Gui in java

Layout Manager

Flow Layout Border Layout Grid layout

Flow Layout: The position of components depends on dimensions of the content pane.

Border Layout: Directions like north, south, west and east as well as center are used to position various components on a pane.

Grid Layout: ‘m’ number of components are divided into ‘n’ number of rows making their positions fixed till there is no change in ‘m’ or ‘n’.

Page 8: Gui in java

The position of components will change on any change in dimensions of the frame

Here positions of components are fixed in various directions and at center.

Here 6 components (3 labels and 3 text-fields) are divided into 3 rows and 2 columns thus making their positions fixed.

Page 9: Gui in java

Various componentsFrame Buttons

Panel 1 Panel 2

Button Panel

Label Text Field

Page 10: Gui in java

Graphics Whenever a component is added to a frame, an instance of

‘Graphics’ class is automatically created. It is the graphics object that invokes paintComponent( )

method to draw the components on the panel. A graphics object is like a pencil or a paintbrush which is

responsible for drawing.

Event – Driven Programming Actions to be taken after clicking a mouse button, pressing a keyboard button, or dragging a mouse come under this category. There are various interfaces known as listeners defined for various button operations. Implementation of these listeners decides actions to be taken on those button operations.

Page 11: Gui in java

Conclusion Definition of GUI Applications of GUI Various components of GUI Various terminologies Graphics & Event – Driven programming

Page 12: Gui in java

THANK YOU