0

Where would I need to save a picture on my computer to be able to use it as an icon on a button in a program?

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by hfx642
1

The general notion is to have following project structure

  • src
    • main
      • java
        • top-package name
      • resources
        • daniweb.png
    • test

Then you can call images from resource directory directly like new ImageIcon(ClassLoader.getSystemResource("daniweb.png")); no need for directory changes (../../../daniweb.png)etc

Edited by peter_budo: n/a

1

Well... What I use is;

+ Project_Name
..> Completed (other custom classes related this project)
..> Resources (images, application data files, etc.)
..> Data (user data files)
..> Logs (any logging data files)
..> Other (other files used to create my resource files)

However, you should use whatever YOU feel comfortable with.

Edited by hfx642: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.