Bug 362 - Cannot show images inside the jar file
Summary: Cannot show images inside the jar file
Status: CONFIRMED
Alias: None
Product: Slot Machine
Classification: Unclassified
Component: slot machine (show other bugs)
Version: 2.0 release
Hardware: PC Mac OS
: High critical
Assignee: billy777
URL:
Depends on:
Blocks:
 
Reported: 2019-12-08 19:20 HKT by josephccs0917
Modified: 2019-12-08 21:10 HKT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description josephccs0917 2019-12-08 19:20:03 HKT
After I opened the jar file released, all the images are not able to display, including the slot items and membership. The game cannot be played completely with the jar version.
Comment 1 billy777 2019-12-08 21:10:58 HKT
The program worked well in the IDE environment, but cannot show images after exported as a jar file. The problem arose because we are not including the images when exporting the jar file. The problem is solved by marking the images folder as resource and we use getClass().getResourceAsStream(image) to get the input stream of image from resources. After configuration, the jar file now works well.