Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 06-14-2006, 11:50 AM   #1
Baseband Member
 
Join Date: Jul 2005
Posts: 55
Default Java Question Please Help

Hey,

I have a problem with a Java app that I'm working on. I need to load a few images (.jpg) at runtime, and their paths cannot be hardcoded. I know java apps don't have a current directory, but is there a way to import the images into my project as resource files? Any help would be appreciated, thanks in advance.
__________________

Argon is offline   Reply With Quote
Old 06-17-2006, 09:54 PM   #2
Fully Optimized
 
rakedog's Avatar
 
Join Date: May 2004
Posts: 2,718
Send a message via AIM to rakedog
Default Re: Java Question Please Help

If they are in the current java directory (the one the main file is in), just do a:

File f = new File(yourpic.jpg);

If you could elaborate on your situation, that would be good. :]
__________________
hackthissite.org (criticalsecurity.net) | gentoo.org

The best argument against evolution are creationists themselves. They prove that life is devolving rather than evolving.
rakedog is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 08:02 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0