(Review: ) What does the statement outPer.setEditable( false ) do?

A good answer might be:

It prevents the user from entering anything into the textfield for the output of the program.

Example Output

Here is an example of what is displayed on the screen after the user has resized the frame. It is not as nice as we might want, but at least the panels have kept the labels and textfields together.

Notice the order in which things were done:

  1. Components were added to the Panels
    • A Panel uses its layout manager for the components it contains.
      • By default, the layout manager of a Panel is FlowLayout
      • .
      • To change to another layout manager usesetLayout()
      • .
  2. Panels were added to the Frame.
    • The Frame's layout manager is used with the added compnents.
      • By default, the layout manager is BorderLayout (which we did not want to use.)
      • We asked for FlowLayout using setLayout().

QUESTION 8:

(Thought question: ) is it possible to add just one component to a Panel?

Click Here after you have answered the question