User 6ef33138f9
12-10-2005 15:05:06
Hello,
We're running JDK 1.5 and using the Synth look-and-feel. If you're not familiar with this, it's a new feature in JDK 1.5:
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/plaf/synth/package-summary.html
When using Synth, creating an MSketchPane fails with a NullPointerException. If we disable Synth (but still use 1.5), it works fine. We're using Marvin 3.5.7. Here's the stack trace:
As you can see, when Synth is activated, some additional calls are made in JPanel.setUI (which is called from the JPanel constructor). Among other things, the Synth UI code calls addPropertyChangeListener on the panel that's being created. Marvin's MolPanel class overrides this method. My guess is that MolPanel.addPropertyChangeListener doesn't expect to be called until its constructor is complete.
Unfortunately we don't have a good workaround, since Synth must be turned on or off for the entire application: there's no way (that I know of) to disable it just for the MSketchPane.
By the way, it's possible that this is the same problem reported here:
http://www.chemaxon.com/forum/ftopic854.html
Thank you,
Chris
We're running JDK 1.5 and using the Synth look-and-feel. If you're not familiar with this, it's a new feature in JDK 1.5:
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/plaf/synth/package-summary.html
When using Synth, creating an MSketchPane fails with a NullPointerException. If we disable Synth (but still use 1.5), it works fine. We're using Marvin 3.5.7. Here's the stack trace:
Code: |
Thread [main] (Suspended (exception java.lang.NullPointerException)) chemaxon.marvin.sketch.swing.SketchPanel(chemaxon.marvin.common.swing.MolPanel).addPropertyChangeListener(java.beans.PropertyChangeListener) line: not available javax.swing.plaf.synth.SynthPanelUI.installListeners(javax.swing.JPanel) line: not available javax.swing.plaf.synth.SynthPanelUI.installUI(javax.swing.JComponent) line: not available chemaxon.marvin.sketch.swing.SketchPanel(javax.swing.JComponent).setUI(javax.swing.plaf.ComponentUI) line: not available chemaxon.marvin.sketch.swing.SketchPanel(javax.swing.JPanel).setUI(javax.swing.plaf.PanelUI) line: not available chemaxon.marvin.sketch.swing.SketchPanel(javax.swing.JPanel).updateUI() line: not available chemaxon.marvin.sketch.swing.SketchPanel(javax.swing.JPanel).<init>(java.awt.LayoutManager, boolean) line: not available chemaxon.marvin.sketch.swing.SketchPanel(javax.swing.JPanel).<init>(boolean) line: not available chemaxon.marvin.sketch.swing.SketchPanel(javax.swing.JPanel).<init>() line: not available chemaxon.marvin.sketch.swing.SketchPanel(chemaxon.marvin.common.swing.MolPanel).<init>(java.awt.Component, int, chemaxon.marvin.common.UserSettings, int[]) line: not available chemaxon.marvin.sketch.swing.SketchPanel.<init>(java.awt.Component, int, int, javax.swing.JRootPane, chemaxon.marvin.common.UserSettings) line: not available chemaxon.marvin.beans.MSketchPane.<init>(chemaxon.marvin.common.UserSettings, boolean) line: not available chemaxon.marvin.beans.MSketchPane.<init>() line: not available |
As you can see, when Synth is activated, some additional calls are made in JPanel.setUI (which is called from the JPanel constructor). Among other things, the Synth UI code calls addPropertyChangeListener on the panel that's being created. Marvin's MolPanel class overrides this method. My guess is that MolPanel.addPropertyChangeListener doesn't expect to be called until its constructor is complete.
Unfortunately we don't have a good workaround, since Synth must be turned on or off for the entire application: there's no way (that I know of) to disable it just for the MSketchPane.
By the way, it's possible that this is the same problem reported here:
http://www.chemaxon.com/forum/ftopic854.html
Thank you,
Chris