2

I am creating a Swing application in which some of the icons and images are being loaded from the resource folder within the project.

File helpIcon = new File("resources/icon/helpIcon.png");

This is working fine in Windows but in Linux this code is giving an error. How should I handle this in different operating systems (like Windows, Linux, MacOS)?

Robb1
  • 4,587
  • 6
  • 31
  • 60

1 Answers1

-1

Try to use getClass().getResources("path")

Irazza
  • 311
  • 2
  • 10