I was tring to add a gif at my java swing project just for fun, but every time I compile the program the gif file corrupts and I can't delete or do anything with it. My code is like:
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/package/images/giphy.gif")));
and I get the following error code: obs. my main package and project name is braia
at java.desktop/javax.swing.ImageIcon.<init>(ImageIcon.java:217)
at braia.TelaBraia.initComponents(TelaBraia.java:34)
at braia.TelaBraia.<init>(TelaBraia.java:18)
at braia.TelaBraia$1.run(TelaBraia.java:83)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)