A good answer might be:

Use setBackground(). In the present program outText.setBackground( Color.green ) matches the text field to the content panel.


End of Chapter

You have reached the end of the chapter. You may wish to review the following. Click on a subject that interests you to go to where it was discussed. To get back here, click on the "back arrow" button of your browser.

The next chapter will show a larger GUI application.



Click here Back to the main menu.

You have reached the end of the chapter.