Before you can define the RatingPanel
constructor, you need to know a
little about the embedded components and the grid layout.
For example, you need to know that instances of the JLabel
class, when added to a panel, display the string provided to the
JLabel
constructor. Thus, when the following add
statement appears inside a panel's constructor, the string assigned to
label
appears at a place dictated by the panel's layout manager:
add(new JLabel(label));