tags:

views:

74

answers:

4

I have an application that includes a JTabbedPane and two tabs with some components. My problem is when I click on another tab, it's components do not appear immediately; but when the mouse courser moves over each component (JCheckBox, JButton and so on) of the tab, the components will appear but not correctly (see below image).

alt text

alt text


This is my CODE . . .

+2  A: 

Are you mixing some awt and swing stuff?

This could probably make such unpredictable effects.

daniel
+1  A: 

Can you see an exception on the console? Exceptions in Event Dispatching Thread can cause such behavior.

Konrad Garus
No Konrad,there is no exception
sirvan
+1  A: 

As others have observed, your code is incomplete. As a guide, consider this article on the benefits of a Short, Self Contained, Correct (Compilable), Example. Several such examples are discussed in How to Use Tabbed Panes. You might compare them with what you're doing.

trashgod
A: 

thanks a milion for your response, the problem was calling repaint() of a component that called when i changing it position, the location of marker must be change every time the map move by user or page event occurred, so i think calling repaint() caused a loop and other component not paint correctly.

sirvan