Hello friends, I have a code for a program that changes the color window and has 3 buttons with an icon or image but I really do not understand why the images do not appear in the JAR, I have the images in the src folder and in sources packages this is a package with my classes and the main one and another is default packages, there are my images, in netbeans it works perfectly. When I unzip my JAR if there are the images but when executing it nothing! someone to help me please.
These lines are responsible for putting the icon on a button, use the library swing.ImageIcon
:
AccionColor accionAmarillo=new AccionColor("Amarillo", new ImageIcon("src/amarillo.jpg"), Color.YELLOW);
AccionColor accionAzul=new AccionColor("Azul ", new ImageIcon("src/azul.jpg"), Color.BLUE);
AccionColor accionRojo=new AccionColor("Rojo ", new ImageIcon("src/rojo.jpg"), Color.RED);