IDE Bug -- code window won't take keyboard focus

I'm running the IDE on Linux, Ubuntu 9.10. To install the IDE, I downloaded the latest 32-bit tarball, and unpacked it into a subdirectory underneath my /home/myname/projects directory. I have quite a lot of java stuff on this machine, as follows:

java-common                         0.30ubuntu5
libappframework-java                1.03-0ubuntu3
libbackport-util-concurrent-java    3.1-2ubuntu2
libcommons-codec-java               1.3-8ubuntu1
libcommons-logging-java             1.1.1-5
libdom4j-java                       1.6.1+dfsg.2-1ubuntu1
libgui-commands-java                1.1.43-3
libhsqldb-java                      1.8.0.10-2ubuntu1
libhsqldb-java-gcj                  1.8.0.10-2ubuntu1
libjava-gnome-java                  4.0.13-3
libjava-gnome-jni                   4.0.13-3
libjaxen-java                       1.1.1-3ubuntu1
libjaxme-java                       0.5.2+dfsg-2ubuntu2
libjaxp1.3-java                     1.3.04-5ubuntu2
libjdom1-java                       1.1+dfsg-3ubuntu1
libjline-java                       0.9.94-5~ubuntu1
liblaf-plugin-java                  1.0-1
liblog4j1.2-java                    1.2.15-4ubuntu1
librxtx-java                        2.1.7r2-4
libsac-java                         1.3-2ubuntu1
libsac-java-gcj                     1.3-2ubuntu1
libservlet2.4-java                  5.0.30-8ubuntu3
libskinlf-java                      6.7-4
libswingworker-java                 1.1-0ubuntu3
libswt-gtk-3.4-java                 3.4.2-3
libswt-gtk-3.4-java-gcj             3.4.2-3
libswt-gtk-3.5-java                 3.5.1+repack~1-0ubuntu4
libxalan2-java                      2.7.1-5ubuntu1
libxerces2-java                     2.9.1-4ubuntu1
libxpp2-java                        2.1.10-4ubuntu1
libxpp3-java                        1.1.3.4.O-4ubuntu2
sun-java6-bin                       6.24-1build0.9.10.1
sun-java6-fonts                     6.24-1build0.9.10.1
sun-java6-jre                       6.24-1build0.9.10.1

That's all packages with 'java' in the name, other than those with 'openoffice' or 'javascript'.
Also, the AWT packages:

libgcj10-awt    4.4.1-5ubuntu2
libgcj9-0-awt   4.3.4-4ubuntu1

I haven't listed all the gij, gcc, avr, etc. packages, because I don't think they're relevant to an IDE problem. But I certainly can.

I have loaded sample sketches and successfully compiled them, uploaded them, and run them on my Uno.

The problem is that I can click in the sketch editor area with the mouse, and I get a text pointer at that point, but when I attempt to type, for example, the delete key, or any ascii character, I get a Java exception. The up/down arrows will move the seperator bar between the editor and output panes.

The output pane displays the following:

BUG: getTextArea() returning null
Report this to Slava Pestov <sp@gjt.org>
Exception during event dispatch:
java.lang.NullPointerException
   at processing.app.syntax.InputHandler$insert_char.actionPerformed(InputHandler.java:1121)
   at processing.app.syntax.InputHandler.executeAction(InputHandler.java:287)
   at processing.app.syntax.DefaultInputHandler.keyTyped(DefaultInputHandler.java:286)
   at processing.app.syntax.JEditTextArea.processKeyEvent(JEditTextArea.java:1629)
   at java.awt.Component.processEvent(libgcj.so.10)
   at java.awt.Container.processEvent(libgcj.so.10)
   at java.awt.Component.dispatchEventImpl(libgcj.so.10)
   at java.awt.Container.dispatchEventImpl(libgcj.so.10)
   at java.awt.Component.dispatchEvent(libgcj.so.10)
   at java.awt.KeyboardFocusManager.redispatchEvent(libgcj.so.10)
   at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(libgcj.so.10)
   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(libgcj.so.10)
   at java.awt.Component.dispatchEventImpl(libgcj.so.10)
   at java.awt.Container.dispatchEventImpl(libgcj.so.10)
   at java.awt.Window.dispatchEventImpl(libgcj.so.10)
   at java.awt.Component.dispatchEvent(libgcj.so.10)
   at java.awt.EventQueue.dispatchEvent(libgcj.so.10)
   at java.awt.EventDispatchThread.run(libgcj.so.10)

I've tried to find a bug database, but didn't see anything. So before I bug the developer, I thought I'd check if this is a known bug.

TIA for any info.

Have you tried apt-getting the IDE? It may have a fix for this problem already.

sudo apt-get install arduino

Aeturnalus:
Have you tried apt-getting the IDE? It may have a fix for this problem already.

sudo apt-get install arduino
$ apt-cache search arduino
$

There are no packages in the 9.10 repositories matching that as a search string. And, the repositories are unlikely to have a newer version than that which is available from the Arduino Google Code site.

Hm... I forget what revision added the Arduino IDE to the repository.

I'm running Ubuntu 11.04 x86_64 on 2.6.35-28-generic, and the 64-bit tarball from Google Code works fine for me. I'm using the openjdk - I notice that you have the Sun Java binaries installed. Try using update-alternatives to set it to the openjdk, and see if that solves the problem. (Alternatively, you should upgrade your ubuntu install, unless there's a reason not to - 9.10 is out of support now, I believe)

Aeturnalus:
Hm... I forget what revision added the Arduino IDE to the repository.

I'm running Ubuntu 11.04 x86_64 on 2.6.35-28-generic, and the 64-bit tarball from Google Code works fine for me. I'm using the openjdk - I notice that you have the Sun Java binaries installed. Try using update-alternatives to set it to the openjdk, and see if that solves the problem. (Alternatively, you should upgrade your ubuntu install, unless there's a reason not to - 9.10 is out of support now, I believe)

I was kinda wondering about using a different JRE. I'll give it a shot.

As far as Ubuntu is concerned, I'm not going to upgrade. Don't know what's next -- maybe Slackware. I've been using Linux since RH5.2 (Not RHEL, RH) -- uh, 1998? I really like apt instead of RPM, but I don't like all the cruft that Canonical is ladling on top of Linux. I'm using Fvwm for my WM. Anyway, that's way OT. :slight_smile:

Switching to OpenJDK certainly improved things. Thanks.

Awesome. I think the Arduino developers might be concerned that the Sun Java binaries don't work though - maybe one of them will swing by this thread and give a reason =).