Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with JScrollPane's updateUI call #563

Closed
mgarin opened this issue Oct 14, 2019 · 2 comments
Closed

Issue with JScrollPane's updateUI call #563

mgarin opened this issue Oct 14, 2019 · 2 comments
Assignees
Projects

Comments

@mgarin
Copy link
Owner

mgarin commented Oct 14, 2019

@Sciss mentioned on Gitter:

I'm running into this:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.ScrollPaneLayout.addSingletonComponent(ScrollPaneLayout.java:202)
    at javax.swing.ScrollPaneLayout.addLayoutComponent(ScrollPaneLayout.java:254)
    at java.awt.Container.addImpl(Container.java:1132)
    at java.awt.Container.add(Container.java:975)
    at javax.swing.JScrollPane.setCorner(JScrollPane.java:1267)
    at com.alee.laf.scroll.WebScrollPaneUI.updateCorners(WebScrollPaneUI.java:575)
    at com.alee.laf.scroll.WebScrollPaneUI.installUI(WebScrollPaneUI.java:94)
    at javax.swing.JComponent.setUI(JComponent.java:666)
    at javax.swing.JScrollPane.setUI(JScrollPane.java:380)
    at javax.swing.JScrollPane.updateUI(JScrollPane.java:393)
    at javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1238)
    at javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1253)
    at javax.swing.SwingUtilities.updateComponentTreeUI(SwingUtilities.java:1229)
    at bibliothek.gui.dock.themes.BasicTheme.updateUI(BasicTheme.java:222)
    at bibliothek.gui.dock.themes.BasicTheme.install(BasicTheme.java:187)
    at bibliothek.gui.dock.themes.BasicTheme.install(BasicTheme.java:170)
    at bibliothek.gui.dock.themes.ThemeManager.setTheme(ThemeManager.java:278)
    at bibliothek.gui.DockController.setTheme(DockController.java:788)
    at bibliothek.gui.DockController.initiate(DockController.java:391)
    at bibliothek.gui.DockController.<init>(DockController.java:275)
    at bibliothek.gui.DockController.<init>(DockController.java:260)
    at bibliothek.gui.dock.common.intern.CDockController.<init>(CDockController.java:47)
    at bibliothek.gui.dock.common.intern.EfficientControlFactory.createController(EfficientControlFactory.java:49)
    at bibliothek.gui.dock.common.CControl.init(CControl.java:497)
    at bibliothek.gui.dock.common.CControl.<init>(CControl.java:475)
    at bibliothek.gui.dock.common.CControl.<init>(CControl.java:459)
    at bibliothek.gui.dock.common.CControl.<init>(CControl.java:404)
    at bibliothek.gui.dock.common.CControl.<init>(CControl.java:381)
    at de.sciss.synth.swing.Main$.dockCtrl$lzycompute(Main.scala:195)

Seems that the caching of scroll pane corners is buggy, because their parents might be null (after previous removal) and this is not handled by ScrollPaneLayout

it's that the docking framework (https://github.com/Benoker/DockingFrames) calls updateComponentTreeUI because it has it's own skinning system. So this after WebLaF has been initialized.

a workaround might be to install a sub-class of ScrollPaneLayout that handles the case where oldC.getParent == null

@mgarin mgarin added the bug label Oct 14, 2019
@mgarin mgarin added this to the v1.2.11 milestone Oct 14, 2019
@mgarin mgarin self-assigned this Oct 14, 2019
@mgarin mgarin added this to Planned in v1.2.11 via automation Oct 14, 2019
@Sciss
Copy link
Contributor

Sciss commented Oct 14, 2019

@mgarin mgarin moved this from Planned to In Progress in v1.2.11 Oct 16, 2019
mgarin added a commit that referenced this issue Oct 16, 2019
- WebScrollPaneUI.java - Fixed incorrect corners removal from `JScrollPane`
- WebScrollPaneUI.java - Fixed styles initialization order
@mgarin
Copy link
Owner Author

mgarin commented Oct 16, 2019

I've fixed this NPE along with a few internal issues that weren't really affecting anything visually.

@mgarin mgarin closed this as completed Oct 16, 2019
v1.2.11 automation moved this from In Progress to Completed Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v1.2.11
  
Completed
Development

No branches or pull requests

2 participants