Answer:
JLabel fatLabel with JTextField inFat JLabel calLabel with JTextField inCal JLabel perLabel with JTextField outPer
Adding Components to JPanels
The idea is to have five panels, one for each pair of label and text field, and a panel each for the heading and the do it button. The picture shows this grouping. (The lines around the panels do not appear in the actual GUI.)
The add() method places components in a panel.
The default layout manager, for JPanel is FlowLayout,
so setLayout()
You need to say which container (which panel) gets each component.
whichPanel.add( objectRef )
means run the add()
method of whichPanel to add the object to that panel.
QUESTION 5:
Fill in the blanks by clicking the buttons.
At this point, the label and button components have been added to some panels, but the panels have not yet been added to the frame.