1 / 22

Programming 2 LAB

Programming 2 LAB. TA: Nouf Al-Harbi NoufNaief.net ::: nouf200@hotmail.com. Lab 10. Introduction to GUI. GUI stands for Graphical User Interface. GUI. A GUI component is an object that represents a screen element such as a button or a text field

Download Presentation

Programming 2 LAB

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. Programming 2 LAB TA: Nouf Al-Harbi NoufNaief.net ::: nouf200@hotmail.com

  2. Lab 10 Introduction to GUI

  3. GUI stands for Graphical User Interface GUI

  4. A GUI component is an object that represents a screen element such as a button or a text field • GUI-related classes are defined primarily in the java.awt and the javax.swing packages • The Abstract Windowing Toolkit (AWT) was the original Java GUI package • The Swing package provides additional and more versatile components • Both packages are needed to create a Java GUI-based program GUI Components

  5. A label is a GUI component that displays a line of text and/or an image GUI Components

  6. A buttonis generate an action event GUI Components

  7. A text fieldallows the user to enter one line of input GUI Components

  8. A check box is a button that can be toggled on or off GUI Components

  9. A group of radio buttonsrepresents a set of mutually exclusive options – only one can be selected at any given time GUI Components

  10. A dialog box is a window that appears on top of any currently active window GUI Components

  11. A GUI container is a component that is used to hold and organize other components • A frameis a container displayed as a separate window with a title bar • It can be repositioned and resized on the screen as needed • A panelis a container that cannot be displayed on its own but is used to organize other components • A panel must be added to another container (like a frame) to be displayed GUI Containers

  12. Examples

  13. Example 1..

  14. Example 1..

  15. OK Button Code

  16. Example 2..

  17. Exit Button Code

  18. Clear Button Code

  19. Add Button Code

  20. Example 2..

  21. http://netbeans.org/kb/docs/java/gui-functionality.html#Exercise_1http://netbeans.org/kb/docs/java/gui-functionality.html#Exercise_1 Useful Reference..

  22. End of Lab 10

More Related