Skip to main content

NPE with 'setEditable(false) on a JTextField wrapped in a JXLayer

5 replies [Last post]
g_billard
Offline
Joined: 2006-11-15

I create a JXLayer and add it to a JPanel using the following code:
mainPane.add(new JXLayer(idField));

Later, I set the "editable" state of the "idField" using:
idField.setEditable(false);

And it result in:
java.lang.NullPointerException
at org.jdesktop.jxlayer.JXLayer$LayerInputContext.endComposition(Unknown Source)
at java.awt.Component.enableInputMethods(Component.java:1238)
at javax.swing.text.JTextComponent.setEditable(JTextComponent.java:1533)

I use a sepcific LayerUI, but tried without it to check wether it wasn't the NPe cause...

Calling idField.setEditable(true) doesn't end with an NPE

Is this a bug in JXLayer or did I missed something ?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
g_billard
Offline
Joined: 2006-11-15

It works fine now :)

Thank you

alexfromsun
Offline
Joined: 2005-09-05

Hello g_billard

It is a bug, thanks for reporting it!

I have just fixed it, try the new jxlayer.jar

please let me know if it works for you

Thanks

alexp

jacek
Offline
Joined: 2003-08-22

Hi Alex, can you start versioning the download versions somehow, so at least we have some idea if we need to upgrade. Right now it's all jxlayer.jar, maybe at least there could be some build # attached to it, e.g. 3.0.025 or something along those lines?

thanks

alexfromsun
Offline
Joined: 2005-09-05

Hello Jacek

Good idea, I'll think how to make it

Thanks

alexp

jacek
Offline
Joined: 2003-08-22

On my project, I just define the build version in the build.properties file, so that when I run my Ant script it creates the jars and the final zip file with the build number appended.

But I am sure I do not have to give you an Ant tutorial :-)