0% found this document useful (0 votes)
9 views17 pages

Java GUI: Creating Frames & Menus

This document discusses graphical user interfaces in Java programs. It covers creating frame windows and menu bars. Menu bars contain pull-down menus at the top of a frame with menu items and checkboxes for user selection. Menus can be nested. The document also discusses colors and fonts in Java, including 13 standard color constants and using the Font class to set font face for text rendering. It includes steps for a lab exercise to create a menu bar with menus and menu items to practice these concepts.

Uploaded by

Aishah Aman
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views17 pages

Java GUI: Creating Frames & Menus

This document discusses graphical user interfaces in Java programs. It covers creating frame windows and menu bars. Menu bars contain pull-down menus at the top of a frame with menu items and checkboxes for user selection. Menus can be nested. The document also discusses colors and fonts in Java, including 13 standard color constants and using the Font class to set font face for text rendering. It includes steps for a lab exercise to create a menu bar with menus and menu items to practice these concepts.

Uploaded by

Aishah Aman
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Presented By

PN SITI NOORAISHAH BINTI MOHAMMAD


Chapter 1 – Graphical User
Interface (GUI) (WEEK 2)
DFP4033 Create Frame Windows and Menu
Bars in Java Programs
INTEGRATIVE PROGRAMMINGAND TECHNOLOGIES
WOODGROVE 2
BANK
MENU BARS
MenuBar
• Displayed on the top line of the Frame. The MenuBar contains
menus.
• Menus are the pull-down objects that appear on the MenuBar.
They contain MenuItems or CheckboxMenuItems for the user to
select.
• A MenuItem is the basic item that goes on a Menu and its
allowing submenus to be nested inside of menus.

WOODGROVE 3
BANK
COLORS AND FONTS
Colors
• provides 13 standard colors as named-constants.
• They are RED, GREEN, BLUE, MAGENTA, CYAN, YELLOW,
BLACK, WHITE, GRAY, DARK_GRAY, LIGHT_GRAY,
ORANGE, and PINK.
• Use to set the background and foreground (text) color of a
component/container.

Fonts
• [Link] represents a specific font face, which can be used
for rendering texts.
• can use the setFont() method to set the current font for the
Graphics context g for rendering texts.

WOODGROVE 4
BANK
LAB EXERCISE 1B

WOODGROVE 5
BANK
LAB EXERCISE 1B

WOODGROVE 6
BANK
LAB EXERCISE 1B

WOODGROVE 7
BANK
LAB EXERCISE 1B

WOODGROVE 8
BANK
LAB EXERCISE 1B

WOODGROVE 9
BANK
LAB EXERCISE 1B

WOODGROVE 10
BANK
LAB EXERCISE 1B

WOODGROVE 11
BANK
LAB EXERCISE 1B

WOODGROVE 12
BANK
LAB EXERCISE 1B

WOODGROVE 13
BANK
LAB EXERCISE 1B

WOODGROVE 14
BANK
LAB EXERCISE 1B

WOODGROVE 15
BANK
LAB EXERCISE 1B

WOODGROVE 16
BANK
THANK YOU

You might also like