A little off topic: Jumping JLabel

I have put my game development on hiatus for the moment and have been building up my swing skills… all was going well but now I have a strange “feature” in my program which is that a JLabel that makes up a status bar periodically spontaneously “jumps up”. The period between jumps is seemingly random.

To help explain what i mean a short video of the problem (MPEG4 and 500k) can be found at http://www.insightz.net/bvhJdnInLnyTjlL9wrAk/jumpingstatusbar.avi

This “jumping” only occurs when the JLabel is formatted using HTML (i.e. to get the bolding of the figures), if the label is just pure text the label behaves as expected and no jumping occurs.

Is there anything special i need to do with the JLabel when using html formatting with the .setText() method? Does anyone have an idea at what might be causing this “jumping”?

Post some brief sample code that reproduces the problem?

I will attempt to do so, however it may be a product of interaction with the other gui elements… If that is the case then i am not sure how to produce short code which will be evquivilent to the main system.

I think it could have something to do with the Jlablel container’s layout manager moving the jlabel as it pleases.

I allways use JEditorPane or JTextPane with setEnabled(false) and setDisabledTextColor(Color.Black) for status bars, you can use html formatted text on them.

ps: This very post moves me from the n00bnes to the "jr member"nes ;D

thanks for the suggestion.

I have not had any success re-producing the error when using a scaled down simplistic example. Hopefully your suggestion may resove the issue.

I have sovled the problem, thankyou for your input!

I am not entirely sure why, but from changing the Layout of the JPanel in which the JLabel resides from FlowLayout to BorderLayout with the JLabel added to the CENTER solved the jumping issue.

heh, go figure!

the black art of the layout managers :-\