Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trouble with this thread.

 
ben riches
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I have this snipplet of code that when I run it without the thread I get my picture up fine also when I run it without the method (CongratulationFrame.dispose() I get the image on the frame fine(but it does not close).
I don't know if I am doing anything wrong here, but if I am could you please help me, with getting this thread right.
Thankyou you lot.
Ben


(Edited post due to long code lines widening page - NEP)
[ February 18, 2004: Message edited by: Nathan Pruett ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you calling the thread that pops up this frame? Is it through a new thread, SwingUtilities, Timers, etc?

How big is the image that you are loading? You may want to load the image outside of this code and save it somewhere as an Image object... this might be an issue of you not giving enough time for the image to load from the file.
 
ben riches
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Nathan,
I have got a splash screen (thread) at the beggining of my code and it works fine, now I have done the design the same way, like this.
there is no problem with the size of the picture as i'm using the same pic, and the class is designed the same way, so there should be no problem there to.
I do not know what i'm doing wrong.
Thanks
Ben

and this is the class where the GUI is designed

(Edited post due to long code lines widening page - NEP)
[ February 19, 2004: Message edited by: Nathan Pruett ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, let's edit the splash screen class to take all the auto-generated, unreadable stuff out of it...





I've used the class like this, and it looks like it works fine -

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic