Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes Trouble with this thread. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Trouble with this thread." Watch "Trouble with this thread." New topic
Author

Trouble with this thread.

ben riches
Ranch Hand

Joined: Nov 08, 2002
Posts: 126
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

Joined: Oct 18, 2000
Posts: 4121

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.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
ben riches
Ranch Hand

Joined: Nov 08, 2002
Posts: 126
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

Joined: Oct 18, 2000
Posts: 4121

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 -

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trouble with this thread.