-3

Im pretty new to SWING and I tried my best but this is what is happening.

I have a interface that looks like this: https://dl.dropboxusercontent.com/u/17524455/nodelete/1.jpg

From the main thread I call:

FrmMain.settextParticipants(5 + "");
FrmMain.setLaps(5 + "");
FrmMain.setRaceType("standard");

And that goes OK.

I Even manage to update the stoptime and time in the upper part of the GUI.

But as soon as I call (in the next line)

PnlRacers.PnlTransparents[0].setNameAndKartNr("01", "RACER");

My UI breaks like this: https://dl.dropboxusercontent.com/u/17524455/nodelete/2.jpg

And the only thing that helps to fix the UI is, when I grab the window and move it around (to my second screen for example). That tells me that the "data" or "functions" are working well I guess... But the REDRAWING (or how to call it) is somehow ok for the first arguments and broken for the last class. After moving around it looks like this: https://dl.dropboxusercontent.com/u/17524455/nodelete/3.jpg

I read something about redraw() and validate() and I tried all on all places and on any element I was working with :(.

Maybe someone knows what the problem could be and if the source should be any help, here it is: https://dl.dropboxusercontent.com/u/17524455/nodelete/TEST.rar

Please help :) Im so lost ...

Oliver Goossens
  • 1,903
  • 3
  • 20
  • 26
  • 2
    ..failing to call the `super` paint method? For better help sooner, post an [MCVE](http://stackoverflow.com/help/mcve) (Minimal Complete and Verifiable Example). – Andrew Thompson Jul 04 '14 at 10:15
  • I was about to post your image until I realized you have enough rep to do it yourself. – Paul Samsotha Jul 04 '14 at 10:23
  • 4
    BTW - you offer the source as an *archive that comes to **186KB***?!? Who exactly do you expect to go wading through that mammoth code base looking for an error? – Andrew Thompson Jul 04 '14 at 10:24
  • Possible Duplicate: http://stackoverflow.com/questions/4921009/swing-how-to-properly-update-the-ui?rq=1 – Dan Temple Jul 04 '14 at 10:33
  • Hi, sadly :-( this is my minimal code. Its only the ui and smallest code co tall it. I did remove all the unnecessary code. Its just ui. + background image and fonts. So the size of the archive is not important. Peeskiller what do you mean by post a image? What can I do by myself please? And no I truly do not ask anyone to check all my code :-) just maybe to confirm if what they think is possible. Plus – Oliver Goossens Jul 04 '14 at 11:01

1 Answers1

-1

Have you tried calling repaint() to the content pane after the change you implemented?

Stelium
  • 1,207
  • 1
  • 12
  • 23