Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  A little off topic: Jumping JLabel  (Read 1316 times)
0 Members and 1 Guest are viewing this topic.
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Posted 2005-10-07 23:32:46 »

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"?

Offline johng

Senior Newbie




Bah.


« Reply #1 - Posted 2005-10-08 00:06:09 »


Post some brief sample code that reproduces the problem?

There's just this and empty space...
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #2 - Posted 2005-10-08 01:14:19 »

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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline f.l.x

Senior Member


Projects: 3


there is no place like 127.0.0.1


« Reply #3 - Posted 2005-10-09 11:00:31 »

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  Grin

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #4 - Posted 2005-10-10 21:16:02 »

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.
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #5 - Posted 2005-10-11 05:01:32 »

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!
Offline f.l.x

Senior Member


Projects: 3


there is no place like 127.0.0.1


« Reply #6 - Posted 2005-10-11 07:43:34 »

the black art of the layout managers  Undecided

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (44 views)
2014-09-23 14:38:19

radar3301 (27 views)
2014-09-21 23:33:17

BurntPizza (62 views)
2014-09-21 02:42:18

BurntPizza (32 views)
2014-09-21 01:30:30

moogie (39 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!