Java's Swing components have a constant background color used to fill the entire component area. To add interest, contrast, and polish to a user interface, override the component's background painting and add a gradient to smoothly vary the color across the background. This tip shows how and demonstrates the effect.
File and folder icons are an important part of the look and feel of the Mac. These icons are available to Java applications through several different classes in Swing and sometimes as UI defaults for Apple's "Mac OS X" look and feel. This article shows to how to get at these icons using Java on a Mac.
Part of the Mac look and feel is the use of standard icons across many applications, like the color wheel for the color picker, or the gear for advanced settings. To promote uniformity across Mac applications, Apple provides these icons via their NSImage class in the AppKit toolkit for Objective C. This article shows how to get at these same standard icons using Java on a Mac.
The Mac automatically adds a Mac-style window frame to all Java windows, but there is more that you can do to make sure Java windows look and feel right on a Mac. This article discusses Swing settings and Mac-specific client properties to control the appearance of window decorations on a Mac.
Grouping together related components helps organize a user interface and make it easier to learn and use. Java provides several border styles for outlining groups, but none of them match the Mac's recessed style. This article shows how to create a recessed border using special UI defaults available to Mac Java applications.
Java's Swing has just one generic notion of a button and just one look for that button. However, Apple's Aqua user interface for the Mac has about a dozen different button types to build stand-alone buttons and bars of adjacent segmented buttons. Each Aqua button type has a specific use, from the purple ? button for help, to glossy OK/Cancel/Open/Save buttons, and recessed scope buttons used to modify search operations. This article shows how to use Apple's "Mac OS X" look and feel for Java to access these hidden button types using Java on a Mac.
The default size of Java's Swing components feels large and clunky when building tightly-packed user interfaces for Mac tool palettes, inspectors, ribbons, and info windows. Beneath Swing, however, Apple's Aqua user interface for the Mac includes predefined smaller component sizes designed explicitly for tightly-packed control panels. This article shows how to use Apple's "Mac OS X" look and feel for Java to create these hidden smaller components using Java on a Mac.
Java's Swing JSlider creates a sliding widget for selecting a number within a fixed range. The sliding "thumb" icon, the track it slides on, tick marks, and labels may be turned on and off, but Swing has no other methods to affect the appearance of a JSlider. That's left up to the current look and feel. This article shows how to use Apple's "Mac OS X" look and feel for Java on a Mac to create smaller JSliders and switch between two thumb icon styles. The article also shows work-arounds for controlling tick and label sizes and colors.
Windows automatically adds a window frame to all Java windows, but there is more that you can do to make sure Java windows look and feel right on Windows XP, Vista, 7, and beyond. This article discusses Swing settings to control the appearance of window decorations on a PC.