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: Working with Graphics

Solving Common Graphics Problems

Problem: I don't know where to put my painting code. Problem: The stuff I paint doesn't show up. Problem: The background of my applet shows up, but the foreground stuff doesn't show up. Problem: My component's foreground shows up, but its background is invisible. The result is that one or more components directly behind my component are unexpectedly visible.

Problem: I used setBackground to set my component's background color, but it seemed to have no effect.

Problem: I'm using the exact same code as a tutorial example, but it doesn't work. Why?

Problem: How do I paint thick lines? patterns? If you don't see your problem in this list, see Solving Common Component Problems(in the Creating a GUI with JFC/Swing trail) and Solving Common Layout Problems(in the Creating a GUI with JFC/Swing trail).

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