diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableUI.java index b46054f1f..23d8b0146 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableUI.java @@ -51,10 +51,10 @@ public class DarkTableUI extends DarkTableUIBridge { private final PropertyChangeListener propertyChangeListener = e -> { String key = e.getPropertyName(); if ("showHorizontalLines".equals(key)) { - boolean b = (boolean) e.getNewValue(); + boolean b = Boolean.TRUE.equals(e.getNewValue()); table.setRowMargin(b ? 1 : 0); } else if ("showVerticalLines".equals(key)) { - boolean b = (boolean) e.getNewValue(); + boolean b = Boolean.TRUE.equals(e.getNewValue()); table.getColumnModel().setColumnMargin(b ? 1 : 0); } else if ("ancestor".equals(key)) { Object oldVal = e.getOldValue(); diff --git a/macos/src/main/java/com/github/weisj/darklaf/platform/macos/ui/MacOSTitlePane.java b/macos/src/main/java/com/github/weisj/darklaf/platform/macos/ui/MacOSTitlePane.java index 815340b08..3f5875441 100644 --- a/macos/src/main/java/com/github/weisj/darklaf/platform/macos/ui/MacOSTitlePane.java +++ b/macos/src/main/java/com/github/weisj/darklaf/platform/macos/ui/MacOSTitlePane.java @@ -243,7 +243,7 @@ protected class PropertyChangeHandler implements PropertyChangeListener { public void propertyChange(final PropertyChangeEvent pce) { String name = pce.getPropertyName(); if ("title".equals(name)) { - titleLabel.setText(pce.getNewValue().toString()); + titleLabel.setText(pce.getNewValue() == null ? "" : pce.getNewValue().toString()); repaint(); } } diff --git a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java index b5775f311..00f505c15 100644 --- a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java +++ b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java @@ -771,7 +771,7 @@ public void propertyChange(final PropertyChangeEvent pce) { getRootPane().repaint(); } } else if ("title".equals(name)) { - titleLabel.setText(pce.getNewValue().toString()); + titleLabel.setText(pce.getNewValue() == null ? "" : pce.getNewValue().toString()); repaint(); } else if ("componentOrientation".equals(name)) { revalidate(); @@ -782,6 +782,7 @@ public void propertyChange(final PropertyChangeEvent pce) { repaint(); } else if ("background".equals(name) && pce.getNewValue() instanceof Color) { Color color = (Color) pce.getNewValue(); + if (color == null) return; JNIDecorationsWindows.setBackground(windowHandle, color.getRed(), color.getGreen(), color.getBlue()); } }