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

Allow theme switching while OE / Edit Dialog is open #41

Open
apocalyptech opened this issue Aug 4, 2023 · 0 comments
Open

Allow theme switching while OE / Edit Dialog is open #41

apocalyptech opened this issue Aug 4, 2023 · 0 comments
Labels
enhancement New feature or request needs investigation Still need to nail down exactly what the issue is

Comments

@apocalyptech
Copy link
Contributor

Right now, BLCMM disallows switching theme when OE or edit dialogs are open. If you try it, you can get a variety of Exceptions depending on what you do next. For instance, mousing over the OE tabs will generate an exception out of JTabbedPane:

java.lang.NullPointerException: Cannot invoke "javax.swing.JTabbedPane.getLayout()" because "this.tabPane" is null
	at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI.scrollableTabLayoutEnabled(BasicTabbedPaneUI.java:332)
	at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI.tabForCoordinate(BasicTabbedPaneUI.java:1740)
	at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI.setRolloverTab(BasicTabbedPaneUI.java:682)
	at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.mouseEntered(BasicTabbedPaneUI.java:4122)
	at java.desktop/javax.swing.plaf.synth.SynthTabbedPaneUI$1.mouseEntered(SynthTabbedPaneUI.java:301)
	at blcmm.gui.components.VariableTabsTabbedPane$MouseListenerWrapper.mouseEntered(VariableTabsTabbedPane.java:285)

Or clicking on the main text area of OE or an edit dialog, you'd end up with this exception in JTextComponent:

2023-08-04 13:59:08 blcmm.Startup$MyExceptionHandler.logError(Startup.java:405) -> class java.lang.NullPointerException: Cannot invoke "javax.swing.text.JTextComponent.putClientProperty(Object, Object)" because "comp" is null
    java.desktop/sun.swing.SwingUtilities2.getAdjustedClickCount(SwingUtilities2.java:1973)
    java.desktop/javax.swing.text.DefaultCaret.mousePressed(DefaultCaret.java:542)
    blcmm.gui.text.HighlightedTextArea$4.mousePressed(HighlightedTextArea.java:470)

I've tried poking at it a bit, thinking maybe there were some calls to JComponent.updateUI() which needed to be made, or something, but in the end I wasn't able to find much and it seemed like a lot of voodoo to me. So, whatever, I'm leaving it for now. Would be nice to figure out someday, though!

@apocalyptech apocalyptech added enhancement New feature or request needs investigation Still need to nail down exactly what the issue is labels Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs investigation Still need to nail down exactly what the issue is
Projects
None yet
Development

No branches or pull requests

1 participant