Java Reference
In-Depth Information
7
explains theclasses andmethods that areusedinitsconstruction.) Expressions such
as
new JPanel () {{ add (lblImage); }}
areaconvenientshorthandfor
inganinstanceofthesubclasspanel,(forthisexample)addingthespecifiedcomponent
to the panel via its object initializer, and returning the panel instance.
Assumingthatthecurrentdirectory contains
SkyView.java
andthe
org
subdir-
ectory,invoke
javac SkyView.java
tocompilethisapplication'ssourcecode.Fol-
what you will see when you specify the values that are shown in the figure's text fields.