Jump to content

My GUI will only load one time in three.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
Deco

Deco

    Newbie

  • Members
  • PipPip
  • 28 posts
Most times I compile the run my GUI I will get a blank frame.
If I compile exactly the same code a few more times eventually it will load and function perfectly.

Anyone know what's going on?
My computer isn't ancient and reinstalling/updating java has not helped.
I am running my program from command line. Using a JDE is not an option.

Thanks


Edit:
*Its started happening regardless of whether I compile it again now. I have also had this problem with other programs although for this particular program it worked fine everytime I ran it yesterday. If code is relevant I shall post my code although I suspect I should narrow down the cause first.
*Sometimes a few components will load and the others will appear if I'm lucky enough for a button to have loaded. What loads and what doesn't appears to be in a specific order starting with the panel and allowing my WEST and EAST button in next.

#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
If it doesn't load, does it appear when you resize the frame?

#3
tate

tate

    Learning Programmer

  • Members
  • PipPipPip
  • 90 posts
Just give a call to repaint the gui or move your setVisible call to after you add everything to the frame. If you show the code I could probably point you to the problem pretty easy as I have had similar problems before.
twas brillig

#4
Deco

Deco

    Newbie

  • Members
  • PipPip
  • 28 posts

tate said:

move your setVisible call to after you add everything to the frame.

This has worked. Thanks once again :)

#5
tate

tate

    Learning Programmer

  • Members
  • PipPipPip
  • 90 posts
No problem. I remember spending hours trying to figure out this simple fix last year around this time. It was very frustrating.
twas brillig