User Controls.stepInto()

The components we discuss in this section are commonly used controls that users need in applications. This is by no means an exhaustive look at the controls Swing makes available. It's just what you need to get started. Anyway, after you are used to working with a few of the controls, it is an easy step to read the API for what other kinds of components you get for free.

JLabel

This is an area. Just a plain area, corresponding to a label in Visual Basic. You can put text on it, which is its usual purpose. Or an image, which is probably a good idea to put there. Labels are just regular folk. Create them like this:

JLabel label = new JLabel("You must conform.");

The text passed to the constructor will show up on the label, ...

Get Java Garage now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.