This lesson should give a firm foundation for graphics in
Swing in java to students in high school who know OOP in java (
abstract, as well as composition). They are in the school's CS major. This year they need to create a project which is a part of their final grade in the CS major, and part of the requirements are a visible GUI. As of such, a lesson plan was created to teach them one of the ways of making GUI in java. However, this lesson doesn't teach what goes on in the background of java GUI. (unintended pun)
What I have:
Currently the lesson plan is as follows:
Purpose: To teach the basics of creating GUI in java, for the students' final project.
Needed knowledge: Object Oriented Programming, as taught in previous grade (In the previous grade they were taught the concepts listed in the Background section)
Needed materials: Computers, preferably one per student (Students can bring their laptops), Internet connection.
Explain the basic objects inside the
AWT, and elaborate on how
Swingis heavily dependent on
AWT. All* objects in
Swingare children of objects in
AWT. Also explain the
Containeressentially contains (hence the fancy name) other
Components and that creates a GUI.
Show the students a simple GUI for a chat application (no server-client, just the gui!) which composes of a
JTextField(for entering messages),
JTextPane(chat history) and
JLabel. This step includes showing them the code.
let them work for the remaining time (45 mins plus
45-time_it_took_to_get_to_this_step) on creating a gui of their own, of their choosing, which can have any
Swingobject they find. The GUI must have
JTextField. Other than that, go wild.
This lesson shows absolutely nothing about what Java does in the background for the GUI. I am talking about the intensive OOP the goes on in the
JFrame class, and the incredible flexibility with everything extending
JLabel and many others to be treated almost identically).
How could I extends one (or more) of the above steps, or possibly add a new one, that will teach these parts of java GUI? I find that these parts are important for anyone who wants to make Java GUI. Would simply saying what I have written in the previous paragraph be enough?
*Haven't checked, but never seen one that isn't.