O'Reilly logo

Java Garage by Eben Hewitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding User Controls

Components.listImportantElements() {

//returns:

  • JButton A button that shows text and can do something when you click it.

  • JLabel An element used generally for holding textual messages.

  • JTextField Like an HTML <input>, this component allows the user to enter text.

  • JEditorPane This lets the user enter text or display text-based files.

  • JScrollPane A container that scrolls. Use it by creating content in a different panel and then adding that panel to the scroll pane.

  • JTabbedPane A container that holds tabbed panes.

/*

Let's talk about a few different, important Swing components in turn. They're just objects, so after you are familiar with their general behavior, you can create them, call setX() methods on them to specify their ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required