-
Question on Frames.
I will come out and say it: this is a project for school. I am not asking for source code to be given to me. Just general help.
I already did one assignment where i had to populate a menu bar using JFrames. Okie Dokie!
Second assignment asks me to use Frames and basically do the same thing by adding a menu bar and subItems to it.
I have emailed the professor on my misunderstanding between the two, and he just reiterated that one you use JFrames, the other assignment just use Frames.
I can't find any information on building a menu bar using Frames, just JFrames. My question to this community:
1.) What is the difference between the two? I know JFrames is backwards compatible and Frames are not. (The bulk of the information I have learned from 'googling' quite some time.)
2.) How is adding a menu bar and the subsequent items different from adding them to a Frame?
Thank you to everybody in advance.
-
Re: Question on Frames.
Take a look at the API for JFrame
JFrame (Java Platform SE 6)
First, note at the top of the page the inheritance hierarchy, in particular that JFrame extends Frame. In short, JFrame is a subclass of Frame. Within that API you can also find a multitude of methods that you have access to for building a Frame or JFrame (note the setMenuBar method of Frame, and setJMenuBar method for JFrame). Technically, Frame is AWT and JFrame is Swing, two architectures for building GUI's (they actually are quite related, Swing being the currently preferred method - see Swing (Java) - Wikipedia, the free encyclopedia ). Get to know that API, because it contains a wealth of information for standard java classes.
-
Re: Question on Frames.
It would seem that the first assignment is designed to use Swing while the second is designed to use awt. I say this because Frame is a part of java.awt.* and JFrame is part of javax.swing.* (Which is an extension of java.awt.Frame). However, without the exact wording of the assignment that is still only an assumption. If, however, I am correct then this will help you out: Short Course