Simulating a Desktop

Some GUI applications keep their entire interface in a single root window, which looks like a desktop environment and contains internal "windows” and icons, elements you’d find on the actual desktop. This style of interface was first used in early versions of the Windows operating system because, at that time, the operating system didn’t support multiple, overlapping real windows for each application, so there was no alternative.

While there are still a few special circumstances in which this kind of interface is actually desirable (for example, if you’re creating an emulation of another computer or a virtual environment and want to keep that world clearly distinct in its own window), most applications would be better off using real windows on the actual desktop.

Applications that stick to a virtual desktop interface out of habit do their users a disservice in a number of ways. Because their internal frames (simulated windows) are restricted to exist within the application’s root window, the user has to compromise between making that window very large so there is room to position the application’s windows in a convenient way, and keeping it small so that the windows of other applications can be seen and accessed conveniently. It’s usually impossible to come up with a happy medium. The user is also prevented from overlapping windows of this application with windows of any other application, even if this would provide a better workflow.

Most of the perceived advantages ...

Get Java Swing, 2nd 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.