TopEvent handlingLayering GUI items

Layering GUI items

It is awkward having the combo boxes be on opposite ends of the window. We can put them both together on the bottom if we first insert them in a JPanel. A JPanel uses a FlowLayout manager - meaning items just fit in the panel from left to right - they don't get put in NORTH, SOUTH, etc., and there is no contentPane to worry about in a JPanel. See PanelComboBoxDrawing.

Check out the "GUI cheat sheet" in the documentation section of the course web page for a good summary of how to use GUI components in your program!


TopEvent handlingLayering GUI items