Add the Components to the Window and Manage Space
Learn to place the components in the window while managing space among them.
Laying out the components for WordBuilder
All the support classes are now finished. Next, add all the components to the WordBuilder window.
First, we will dd the instance variables.
- In
WordBuilder
class, add a private static final string instance variable calledFILENAME
, set to “highScores.txt”. - Add a private static final
Color
instance variable calledTAN
, set to a new color with red, green, and blue values of222
,191
, and168
. - Add private static final Font instance variables called
SMALLFONT
andBIGFONT
, set to new fonts in the Dialog family. ForSMALLFONT
, use plain and size12
. ForBIGFONT
, use bold and size30
. (Hint: use Font’sDIALOG
,PLAIN
, andBOLD
variables.)
...
private static final int MAX = 15;
__________________ FILENAME = _______________;
__________________ TAN = _______________;
__________________ SMALLFONT = _______________;
__________________ BIGFONT = _______________;
...
Get hands-on with 1200+ tech skills courses.