The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: Creating a GUI with JFC/Swing
Lesson: Using Swing Components

Solving Common Component Problems

This section discusses problems that you might encounter while using components. If you don't find your problem in this section, consult the following sections:

Problem: I'm having trouble implementing a model (or some other code that's similar to something already in Java 2 Platform, Standard Edition).

Problem: Whenever the text in my text field updates, the text field's size changes. Problem: Certain areas of the content pane look weird when they're repainted.

Problem: My program is exhibiting weird symptoms that sometimes seem to be related to timing.

Problem: My modal dialog gets lost behind other windows.

Problem: The scroll bar policies don't seem to be working as advertised.

Problem: My scroll pane has no scroll bars. Problem: The divider in my split pane don't move! Problem: The setDividerLocation method of JSplitPane doesn't work. Problem: The borders on nested split panes look too wide. Problem: The buttons in my tool bar are too big. Problem: The components in my layered pane aren't layered correctly. In fact, the layers seem to be inversed — the lower the depth the higher the component.

Problem: The method call colorChooser.setPreviewPanel(null) does not remove the color chooser's preview panel as expected.

Problem: I can't make HTML tags work in my labels or buttons or... (See Using HTML in Swing Components for an example.)


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.