Skip to main content

JavaME with TotalMedia Theatre player

2 replies [Last post]
Joined: 2009-10-04

Hi all,

I have Java experience, but am a newbie to BD-J, so thank you in advance for your help. I'm using the JavaME 3.0 tools to compile a test Xlet application. Then attempting to run the code via Total Media Theatre. The code is simply the default code generated by JavaME, so there isn't anything fancy going on.

However, when I attempt to run the code I'm getting the error that is copied below, despite the fact that I'm not trying to do any thing with the keyboard.

I've found mention of this error previously, but only an inconclusive mention that perhaps it is a bug with the player? Have others experienced this too?

Thank you again!

Here is my code:

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Graphics;
import java.awt.Font;
import org.havi.ui.HScene;
import org.havi.ui.HSceneFactory;

* @author dab
public class BDJInput implements {

//private static Font font;
private HScene scene;
private Container gui;
private static final String message = "Hello BD-J World!";
private Font font;

* Default constructor without arguments should be.
public BDJInput() {

* Put your initialization here, not in constructor.
* If something goes wrong, XletStateChangeException
* should be thrown.
public void initXlet( context)
throws {

font = new Font(null, Font.PLAIN, 48);

scene = HSceneFactory.getInstance().getDefaultHScene();

gui = new Container() {
public void paint(Graphics g) {
g.setColor(new Color(255, 10, 10));
g.fillRect(20, 20, getWidth() - 40, getHeight() - 40);
g.setColor(new Color(245, 245, 245));
int message_width = g.getFontMetrics().stringWidth(message);
g.drawString(message, (getWidth() - message_width) / 2, 500);


gui.setSize(1920, 1080); // BD screen size

scene.add(gui, BorderLayout.CENTER);


* Xlet will be started here.
* If something goes wrong, XletStateChangeException
* should be thrown.
public void startXlet() throws {

* Free resources, stop unnecessary threads, remove
* itself from the screen.
public void pauseXlet() {

* Destroy yout xlet here.
* If parameter is false, you can try to not destroy xlet
* by throwing an XletStateChangeException
public void destroyXlet(boolean unconditional)
throws {
scene = null;

Here is the error:

[14:29:47.515] [error] Exception occurred during event dispatching:
[14:29:47.515] [error] java.lang.SecurityException: this KeyboardFocusManager is not installed in the current thread's context
[14:29:47.515] [error] at java.awt.KeyboardFocusManager.getGlobalActiveWindow(
[14:29:47.515] [error] at java.awt.DefaultKeyboardFocusManager.dispatchEvent(
[14:29:47.515] [error] at java.awt.Component.dispatchEventImpl(
[14:29:47.515] [error] at java.awt.Window.dispatchEventImpl(
[14:29:47.515] [error] at java.awt.Component.dispatchEvent(
[14:29:47.515] [error] at java.awt.EventQueue.dispatchEvent(
[14:29:47.515] [error] at java.awt.EventQueueProxy.dispatchEvent(
[14:29:47.515] [error] at java.awt.EventDispatchThread.pumpOneEvent(
[14:29:47.515] [error] at java.awt.EventDispatchThread.pumpEvents(
[14:29:47.515] [error] at java.awt.EventDispatchThread.pumpEvents(
[14:29:47.515] [error] at
[14:29:47.515] [error] at java.lang.Thread.startup(

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-01-14

It is a harmless TMT bug - I get it all the time and just ignore it.

Joined: 2006-11-08

Hi David,

This error is probably a known TMT issue, since I've been seeing it often during my testing as well. The apps seem to run fine even with this exception for me. So if your application is not working, then perhaps you have another exception somewhere in the log?