Go Back   Computer Forums > General Computing > Programming
Join Computer forums Today

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


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, 08: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

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 03:41 AM.

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