CHAPTER 8

image

Using Swing’s JTree

The JTree component defined in the javax.swing package is commonly used to display hierarchical data such as the contents of a file system. Even if you’ve never used JTree before, you’ve almost certainly seen a component like the one that appears on the left side of the Windows Explorer application (see Figure 8-1).

9781484206423_Fig08-01.jpg

Figure 8-1. Windows Explorer represents the relationships between a set of disks and directories

This chapter describes how to use JTree and illustrates how to provide some functionality that’s often ...

Get Pro Java 8 Programming, Third Edition 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.