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?

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

Member Avatar for hfx642

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.