Introduction to GUI programming
Lab 10
We will create a frame with a
title, menubar and buttons and labels in its contentPane for this lab.
- Create a frame using JFrame
Class. Name this frame “My Frame” or any other title you want to.
- Add a menu bar to this frame. The menu bar will have
two menus File and Edit
File Menu will
have three Menu Items Open, Save, Print.
Edit Menu will
have three Menu Items Copy, Cut and Paste
- Create two Labels and three buttons using JLabel and JButton Classes.
- Add this to the content Pane using BorderLayout Manager.
- Add ActionListeners to all
the menu items and buttons. Whenever a Component is selected or clicked
on, the information about that component should be printed.