question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0

See original GitHub issue

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0 at java.desktop/java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016) at java.desktop/java.awt.image.BufferedImage.<init>(BufferedImage.java:333) at com.formdev.flatlaf.util.ScaledImageIcon.image2bufferedImage(ScaledImageIcon.java:175) at com.formdev.flatlaf.util.ScaledImageIcon.paintIcon(ScaledImageIcon.java:121) at java.desktop/javax.swing.plaf.basic.BasicLabelUI.paint(BasicLabelUI.java:191) at com.formdev.flatlaf.ui.FlatLabelUI.paint(FlatLabelUI.java:248) at java.desktop/javax.swing.plaf.ComponentUI.update(ComponentUI.java:161) at java.desktop/javax.swing.JComponent.paintComponent(JComponent.java:852) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1128) at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:961) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1137) at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:961) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1137) at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:961) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1137) at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:586) at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:961) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1137) at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5318) at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(RepaintManager.java:1656) at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1631) at java.desktop/javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1569) at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1336) at java.desktop/javax.swing.JComponent._paintImmediately(JComponent.java:5266) at java.desktop/javax.swing.JComponent.paintImmediately(JComponent.java:5076) at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:878) at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:861) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:861) at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:834) at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:784) at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1897) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742) 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)

I got this error while building project while using flatlaf library. is there any way to solve this problem?

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
DevCharlycommented, Nov 14, 2022

Why wait for FlatLaf 3?

The problem is in your app. You can fix it. The icon file is probably missing or you use a wrong name to load it.

0reactions
chauvanhieucommented, Nov 14, 2022

oh i know how. I already know how to solve it with my app. thank sir

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception in thread "AWT-EventQueue-0" java.lang ...
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0 · Ask Question. Asked ...
Read more >
every IDEs fails to start with Exception in thread "AWT ...
it fails to start with the message. Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0.
Read more >
IllegalArgumentException - Width (0) and height (0) cannot be ...
Uncaught Exception! IllegalArgumentException - Width (0) and height (0) cannot be <= 0 java.lang.IllegalArgumentException: Width (0) and ...
Read more >
How to solve the error: Exception in thread "AWT-EventQueue ...
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Comparison method violates its general contract! at java.util.TimSort.mergeHi(Unknown ...
Read more >
[Solved] Exception in thread "AWT-eventqueue-0" java.lang ...
Two things: 1) Just dumping your whole app on us and saying in effect "you sort it out - I can't be bothered...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found