ptg7068951
Workshop 185
Q&A
Q. How are components arranged if I don’t assign a layout manager to a
container?
A. In a simplecontainer such as a panel,components are arranged using
FlowLayoutby default. Each component is added in the same manner
that words are displayed on a page in English,from left to right,then
down to the next line when there’s no more room. Frames,windows,
and applets use the GridLayoutdefault layout style you learn about
during the next hour.
Q. Why do so many of the graphical user interface classes have names
preceded by a J,such as JFrameandJLabel?
A. These classes are a part of the Swing framework,which was the sec-
ond attempt at graphical user interface classes in the Java class
library. The Abstract Windowing Toolkit (AWT) was first,and it had sim-
pler class names like FrameandLabel.
The AWT classes belong to the java.awtpackage and related pack-
ages,while Swing belong to javax.swingand the like,so they could
have the same class names. The use of the J names keeps the class-
es from being mistaken for each other.
Swing classes also are called Java Foundation Classes (JFC).
Q. Where can I buy an uncut sheet of $1 bills?
A. The U.S. Bureau of Engraving and Printing sells sheets of real $1,$10,
$20 and $50 bills at the website http://www.moneyfactorystore.gov.
A sheet of 32 $1 bills sells for $55,16 $10 bills for $269,16 $20
bills for $409,and 16 $50 bills for $900.
The bureau also sells a five-pound bag containing $10,000 of shredded
bills for $45.
Workshop
If your brain hasn’t been turned into a GUI mush with this hour’s toil,test
your skills by answering the following questions.