Skip to content

Commit

Permalink
Merge branch 'JFormDesigner:main' into classx
Browse files Browse the repository at this point in the history
  • Loading branch information
dar-dev authored May 10, 2024
2 parents 2807321 + 3f3ef6b commit b28e94f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
FlatLaf Change Log
==================

## 3.5-SNAPSHOT

#### Incompatibilities

- ProgressBar: Log warning (including stack trace) when uninstalling
indeterminate progress bar UI or using JProgressBar.setIndeterminate(false)
not on AWT thread, because this may throw NPE in FlatProgressBarUI.paint().
(issues #841 and #830)


## 3.4.1

#### Fixed bugs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static com.formdev.flatlaf.FlatClientProperties.*;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
Expand Down Expand Up @@ -86,6 +87,17 @@ public void installUI( JComponent c ) {
installStyle();
}

@Override
public void uninstallUI( JComponent c ) {
if( !EventQueue.isDispatchThread() && progressBar.isIndeterminate() ) {
LoggingFacade.INSTANCE.logSevere(
"FlatLaf: Uninstalling indeterminate progress bar UI not on AWT thread may throw NPE in FlatProgressBarUI.paint(). Use SwingUtilities.invokeLater().",
new IllegalStateException() );
}

super.uninstallUI( c );
}

@Override
protected void installDefaults() {
super.installDefaults();
Expand All @@ -110,6 +122,14 @@ protected void installListeners() {

propertyChangeListener = e -> {
switch( e.getPropertyName() ) {
case "indeterminate":
if( !EventQueue.isDispatchThread() && !progressBar.isIndeterminate() ) {
LoggingFacade.INSTANCE.logSevere(
"FlatLaf: Using JProgressBar.setIndeterminate(false) not on AWT thread may throw NPE in FlatProgressBarUI.paint(). Use SwingUtilities.invokeLater().",
new IllegalStateException() );
}
break;

case PROGRESS_BAR_LARGE_HEIGHT:
case PROGRESS_BAR_SQUARE:
progressBar.revalidate();
Expand Down
4 changes: 2 additions & 2 deletions flatlaf-intellij-themes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ Otherwise, download `flatlaf-intellij-themes-<version>.jar` here:
How to use?
-----------

Choose a theme (see list below) and invoke its `install` method. E.g.:
Choose a theme (see list below) and invoke its `setup` method. E.g.:

~~~java
FlatArcOrangeIJTheme.install();
FlatArcOrangeIJTheme.setup();
~~~


Expand Down

0 comments on commit b28e94f

Please sign in to comment.