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