JLabel fatLabel with JTextField inFat JLabel calLabel with JTextField inCal JLabel perLabel with JTextField outPer
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.)
add() method places components in a panel.
The default layout manager, for
You need to say which container (which panel) gets each component.
whichPanel.add( objectRef )
means run the
whichPanel to add the object to that panel.
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.