Answer:
JPanel fatPanel = new JPanel();
JPanel calPanel = new JPanel();
JPanel perPanel = new JPanel();
public percentFatPanel()
{
setTitle( "Calories from Fat" );
outPer.setEditable( false );
setLayout( new FlowLayout() );
hedPanel.add( heading );
fatPanel.add( fatLabel );
fatPanel.add( inFat );
calPanel.add( calLabel );
calPanel.add( inCal );
perPanel.add( perLabel );
perPanel.add( outPer );
butPanel.add( doit );
. . . .
}
Adding Panels to the Frame
Now add the panels to the frame.
This is being done in the constructor for the JFrame
so add() means use the method of that frame.
QUESTION 6:
Add the components from top to bottom