1 / 13

JAVA GUI Graphical user interface

JAVA GUI Graphical user interface. Eng. Amr Nagy. Introduction. GUI presents a user-friendly mechanism for interacting with an application.

Download Presentation

JAVA GUI Graphical user interface

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. JAVA GUI Graphical user interface Eng. Amr Nagy

  2. Introduction • GUI presents a user-friendly mechanism for interacting with an application. • GUI (pronounced “GOO-ee”) gives an application a distinctive “look” and “feel.” Providing different applications with consistent, intuitive user interface components allows users to be somewhat familiar with an application, so that they can learn it more quickly and use it more productively.

  3. Simple GUI-Based Input/Output with JOptionPane

  4. Simple GUI-Based Input/Output with JOptionPane // obtain user input from JOptionPane input dialogs String firstNumber = JOptionPane.showInputDialog( "Enter first integer" ); // display result in a JOptionPane message dialog JOptionPane.showMessageDialog( null, "The sum is " + sum,"Sum of Two Integers", JOptionPane.PLAIN_MESSAGE );

  5. Example

  6. Some basic GUI components

  7. Event-Driven Programming • Code is executed upon activation of events. • An event can be defined as a type of signal to the program that something has happened. • The event is generated by external user actions such as mouse movements, mouse clicks, and keystrokes, or by the operating system, such as a timer.

  8. The Delegation Model An event is triggered by user actions on the source object; the source object generates the event object and invokes the handler of the listener object to process the event.

  9. The Delegation Model Example

  10. Selected User Actions

  11. Selected Event Handlers

  12. Exercise

  13. Questions

More Related