magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1998 > 04 > Java@Work  

Java's Swing Library: Part 2

Last month, I introduced you to the Swing library and showed you how to create and use components like menus, icons, tool tips, and borders that are enhancements to the Abstract Window Toolkit (AWT). List boxes and combo boxes, on the other hand, work in Swing much as they do in the old AWT, but they also have increased functionality if you need it. In addition, some conveniences have been added; for example, JList has a constructor that takes an array of type String, whereas JComboBox does not. Listing One shows the basic use of each.

Something else that seems a bit odd at first is that a JList does not automatically provide scrolling, even though that's something you always expect. Adding support for scrolling turns out to be quite easy, as also shown in Listing One: You simply wrap the JList in a JScrollPane, and all the details are automatically managed for you.

Sliders and Progress Bars

A slider allows the user to input data by moving a point back and forth, which is intuitive in some situations (volume controls, for example).




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2