Program sample using PC to control NXT via USB and Bluetooth

Post your NXJ projects, project ideas, etc here!

Moderators: roger, 99jonathan, imaqine

Program sample using PC to control NXT via USB and Bluetooth

Postby SpikeT » Tue Sep 22, 2009 4:08 am

I want to post this code for someone who has just come in contact with NXT and want to see more example of what lejos + java could do.
I'm no expert myself, so I would love to hear comments from other people too. :x

The program may seem to have lots of unnecessary code in it that because I plan to use them on my project later on.

The NXT setup for this program is very simple. You will only need to have the Brick and Two Motors, no sensor is needed.


Code: Select all
/*
 * September 21, 2009
 * Author Tawat Atigarbodee
 *
 * This program creates a Control Window for controlling NXT brick running NXTtr.java via USB.
 *
 * To compile this program.
 *  -   Install Lejos 0.8.5
 *  -   Include Lejos_nxj library to the project path
 *  -   Compile the program with javac (I use Eclipse)
 *
 * To use this program
 *  -   At NXT brick, run NXTtr.java
 *  -   Run NXTremoteControl_TA
 *  -   **Click “Connect” button first**
 *  -   Control the robot by using buttons or keyboard
 *       a, w, s, d for direction
 *       i for speed up and  k for slow down
 *
 * Note: This program is a partial of my project file.
 * I use “USBSend” and “USBReceive” created by Lawrie Griffiths
 * as a pattern for creating USB communication between PC and NXT.
 *
 */

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;

import lejos.pc.comm.NXTConnector;

public class NXTremoteControl_TA extends JFrame
{
  public static JButton quit, connect;
  public static JButton forward,reverse, leftTurn, rightTurn, stop, speedUp, slowDown;
  public static JLabel L1,L2,L3,L4,L5,L6,L7,L8,L9,L10;
  public static ButtonHandler bh = new ButtonHandler();
  public static DataOutputStream outData;
  public static NXTConnector link;
 
  public NXTremoteControl_TA()
  {
    setTitle ("Control");
    setBounds(650,350,500,500);
    setLayout(new GridLayout(4,5));
   
    L1 = new JLabel("");
    add(L1);
    forward = new JButton("Forward");
    forward.addActionListener(bh);
    forward.addMouseListener(bh);
    forward.addKeyListener(bh);
    add(forward);
    L2 = new JLabel("");
    add(L2);
    L3 = new JLabel("");
    add(L3);
    speedUp = new JButton("Accelerate");
    speedUp.addActionListener(bh);
    speedUp.addMouseListener(bh);
    speedUp.addKeyListener(bh);
    add(speedUp);

    leftTurn = new JButton("Left");
    leftTurn.addActionListener(bh);
    leftTurn.addMouseListener(bh);
    leftTurn.addKeyListener(bh);
    add(leftTurn);
    stop = new JButton("Stop");
    stop.addActionListener(bh);
    stop.addMouseListener(bh);
    stop.addKeyListener(bh);
    add(stop);
   
    rightTurn = new JButton("Right");
    rightTurn.addActionListener(bh);
    rightTurn.addMouseListener(bh);
    rightTurn.addKeyListener(bh);
    add(rightTurn);
    L4 = new JLabel("");
    add(L4);
    slowDown = new JButton("Decelerate");
    slowDown.addActionListener(bh);
    slowDown.addMouseListener(bh);
    slowDown.addKeyListener(bh);
    add(slowDown);
   
    L5 = new JLabel("");
    add(L5);
    reverse = new JButton("Reverse");
    reverse.addActionListener(bh);
    reverse.addMouseListener(bh);
    reverse.addKeyListener(bh);
    add(reverse);
   
    L6 = new JLabel("");
    add(L6);
    L7 = new JLabel("");
    add(L7);
    L8 = new JLabel("");
    add(L8);

    connect = new JButton(" Connect ");
    connect.addActionListener(bh);
    connect.addKeyListener(bh);
    add(connect);

    L9 = new JLabel("");
    add(L9);
    L10 = new JLabel("");
    add(L10);
   
    quit = new JButton("Quit");
    quit.addActionListener(bh);
    add(quit);

  }
 
  public static void main(String[] args)
  {
     NXTremoteControl_TA NXTrc = new NXTremoteControl_TA();
     NXTrc.setVisible(true);
     NXTrc.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }//End main
 
  private static class ButtonHandler implements ActionListener, MouseListener, KeyListener
  {
//***********************************************************************
  //Buttons action
    public void actionPerformed(ActionEvent ae)
    {
      if(ae.getSource() == quit)  {System.exit(0);}
      if(ae.getSource() == connect) {connect();}
     
      try{
         if(ae.getSource() == speedUp) {outData.writeInt(6);}
         if(ae.getSource() == slowDown) {outData.writeInt(7);}
         outData.flush(); //This forces any buffered output bytes to be written out to the stream.
        }
         catch (IOException ioe) {
        System.out.println("\nIO Exception writeInt");
         }
     
     }//End ActionEvent(for buttons)

//***********************************************************************
//Mouse actions
    public void mouseClicked(MouseEvent arg0) {}

   public void mouseEntered(MouseEvent arg0) {}

   public void mouseExited(MouseEvent arg0) {}

   public void mousePressed(MouseEvent moe)
   {   
         try {
            if(moe.getSource() == forward)outData.writeInt(1);
            if(moe.getSource() == reverse)outData.writeInt(2);
            if(moe.getSource() == leftTurn)outData.writeInt(3);
            if(moe.getSource() == rightTurn)outData.writeInt(4);
            if(moe.getSource() == speedUp)outData.writeInt(6);
            if(moe.getSource() == slowDown)outData.writeInt(7);
         
            outData.flush();
            }
         catch (IOException ioe) {
            System.out.println("\nIO Exception writeInt");
         }
       
   }//End mousePressed

   public void mouseReleased(MouseEvent moe)
   {
       try {
         if(moe.getSource() == forward ||
            moe.getSource() == reverse ||
            moe.getSource() == leftTurn ||
            moe.getSource() == rightTurn)
           {outData.writeInt(5);}
         if(moe.getSource() == slowDown)outData.writeInt(60);
         if(moe.getSource() == speedUp)outData.writeInt(70);
         
         outData.flush();
          }
        catch (IOException ioe) {
           System.out.println("\nIO Exception writeInt");
        }
      
   }//End mouseReleased

//***********************************************************************
//Keyboard action
   public void keyPressed(KeyEvent ke) {}//End keyPressed

   public void keyTyped(KeyEvent ke)
   {
      try {
         if(ke.getKeyChar() == 'w')outData.writeInt(1);
          if(ke.getKeyChar() == 's')outData.writeInt(2);
         if(ke.getKeyChar() == 'a')outData.writeInt(3);
         if(ke.getKeyChar() == 'd')outData.writeInt(4);
          if(ke.getKeyChar() == 'i')outData.writeInt(6);
          if(ke.getKeyChar() == 'k')outData.writeInt(7);
         
         outData.flush();
         }
      catch (IOException ioe) {
         System.out.println("\nIO Exception writeInt");
         }
        
   }//End keyTyped
   
   public void keyReleased(KeyEvent ke)
   {
       try {
          if(ke.getKeyChar() == 'w'){outData.writeInt(10);}
          if(ke.getKeyChar() == 's'){outData.writeInt(20);}
          if(ke.getKeyChar() == 'a'){outData.writeInt(30);}
          if(ke.getKeyChar() == 'd'){outData.writeInt(40);}
          if(ke.getKeyChar() == 'i'){outData.writeInt(60);}
          if(ke.getKeyChar() == 'k'){outData.writeInt(70);}
         if(ke.getKeyChar() == 'q'){System.exit(0);}
          
          outData.flush();
          }
        
        catch (IOException ioe) {
           System.out.println("\nIO Exception writeInt");
        }
   }//End keyReleased

  }//End ButtonHandler
 
  public static void connect()
  {
     link = new NXTConnector();
   
     if (!link.connectTo("usb://"))
     {
        System.out.println("\nNo NXT find using USB");
        }
    
     outData = link.getDataOut();
     System.out.println("\nNXT is Connected");   
    
  }//End connect
 
  public static void disconnect()
  {
     try{
        outData.close();
        link.close();
        }
     catch (IOException ioe) {
        System.out.println("\nIO Exception writing bytes");
     }
     System.out.println("\nClosed data streams");
    
  }//End disconnect
}//End ControlWindow class





Download this one onto NXT brick

Code: Select all
/*
 * September 21, 2009
 * Author by Tawat Atigarbodee
 *
 * Install this program on to NXT brick and use it with NXTremoteControl_TA.java
 *
 * To use this program.
 *  -   Install Lejos 0.8.5
 *  -   Include Lejos_nxj library to the project path
 *  -   Upload the program using lejosdl.bat (I use Eclipse)
 *  -   To exit the program, restart NXT brick (remove battery)
 *
 * NXT setup
 *  -  Port A for right wheel
 *  -  Port C for left wheel
 *  -  No sensor is needed
 * 
 * Note: This program is a partial of my project file.
 * I use “USBSend” and “USBReceive” created by Lawrie Griffiths
 * as a pattern for creating USB communication between PC and NXT.
 */

import java.io.*;
import lejos.nxt.*;
import lejos.nxt.comm.*;


public class NXTtr
{
  public static DataOutputStream dataOut;
  public static DataInputStream dataIn;
  public static USBConnection USBLink;
  public static BTConnection BTLink;
  public static BTConnection btLink;
  public static int speed =50, turnSpeed = 50,speedBuffer, speedControl;
  public static int commandValue,transmitReceived;
  public static boolean[] control = new boolean[6];
  public static boolean[] command = new boolean[6];

   
 public static void main(String [] args)
 {
  connect();
 
  while(true)
  {
   control = checkCommand();
   speedControl = getSpeed(control);
   move(control, speedControl);
   }
 }//End main
 
 public static boolean[] checkCommand()//check input data
 {
   
    try {
       transmitReceived = dataIn.readInt();

       if(transmitReceived == 1) {command[0] = true;}//forward
       if(transmitReceived == 10){command[0] = false;}
       if(transmitReceived == 2) {command[1] = true;}//backward
       if(transmitReceived == 20){command[1] = false;}
       if(transmitReceived == 3) {command[2] = true;}//leftTurn
       if(transmitReceived == 30){command[2] = false;}
       if(transmitReceived == 4) {command[3] = true;}//rightTurn
       if(transmitReceived == 40){command[3] = false;}
       if(transmitReceived == 5) {command[0] = false;//stop
                                  command[1] = false;
                                  command[2] = false;
                                  command[3] = false;}
       if(transmitReceived == 6) {command[4] = true;}//speed up
       if(transmitReceived == 60){command[4] = false;}
       if(transmitReceived == 7) {command[5] = true;}//slow down
       if(transmitReceived == 70){command[5] = false;}
       else{};
       }
   
    catch (IOException ioe) {
       System.out.println("IO Exception readInt");
       }
    return command;
   
 }//End checkCommand
 
 public static void move(boolean[]D, int S)
 {
  int movingSpeed;
  boolean[] direction = new boolean[4];

  direction[0] = D[0];
  direction[1] = D[1];
  direction[2] = D[2];
  direction[3] = D[3];
 
  movingSpeed = S;

  Motor.A.setSpeed(movingSpeed);
  Motor.C.setSpeed(movingSpeed);
 
 
  if(direction[0] == true)
    {
     Motor.A.forward(); 
      Motor.C.forward();
      }
 
  if(direction[1] == true)
    {
     Motor.A.backward(); 
      Motor.C.backward();
      }
   
  if(direction[2] == true)
    {
     Motor.A.setSpeed(turnSpeed);
      Motor.C.setSpeed(turnSpeed);
      Motor.A.forward();
      Motor.C.backward();
      }
   
  if(direction[3] == true)
    {
     Motor.A.setSpeed(turnSpeed);
      Motor.C.setSpeed(turnSpeed);
      Motor.A.backward();
      Motor.C.forward();
      }
   
  if(direction[0] == true && direction[2] == true)
    {
     speedBuffer =  (int) (movingSpeed *1.5);
     
     Motor.A.setSpeed(speedBuffer);
      Motor.C.forward();
      Motor.A.forward();
      }
   
  if(direction[0] == true && direction[3] == true)
    {
     speedBuffer =  (int) (movingSpeed *1.5);
     
     Motor.C.setSpeed(speedBuffer);
      Motor.C.forward();
      Motor.A.forward();
      }
       
  if(direction[1] == true && direction[2] == true)
    {
     speedBuffer =  (int) (movingSpeed *1.5);
     
     Motor.A.setSpeed(speedBuffer);
      Motor.C.backward();
      Motor.A.backward();
      }
   
  if(direction[1] == true && direction[3] == true)
    {
     speedBuffer =  (int) (movingSpeed *1.5);
       
      Motor.C.setSpeed(speedBuffer);
      Motor.C.backward();
      Motor.A.backward();
      }
   
    if(direction[0] == false && direction[1] == false &&
       direction[2] == false && direction[3] == false)
    {
      Motor.A.stop();
      Motor.C.stop();
      }
   
 }//End move
 
 public static void connect()
 { 
    System.out.println("Listening");
    //BTLink = Bluetooth.waitForConnection();   
    //dataOut = BTLink.openDataOutputStream();
    //dataIn = BTLink.openDataInputStream();
   USBLink = USB.waitForConnection();
   dataOut = USBLink.openDataOutputStream();
   dataIn = USBLink.openDataInputStream();

 }//End connect
 
 public static int getSpeed(boolean[] D)
 {
    boolean accelerate, decelerate;
 
     accelerate = D[4];
     decelerate = D[5];
     
     if(accelerate == true)
     {
        speed += 50;
        command[4] = false;
        }
     
     if(decelerate == true)
     {
        speed -= 50;
        command[5] = false;
        }
     
     return speed;
     }//End getSpeed
 
}//NXTtr Class

Last edited by SpikeT on Tue Mar 23, 2010 5:51 pm, edited 1 time in total.
SpikeT
New User
 
Posts: 19
Joined: Tue Sep 22, 2009 3:44 am

Postby SpikeT » Wed Sep 23, 2009 7:49 am

Well, no one comment anything? :(
SpikeT
New User
 
Posts: 19
Joined: Tue Sep 22, 2009 3:44 am

Postby lawrie » Fri Sep 25, 2009 8:38 pm

Your program looks like a good example of remote control from the PC. It should work over Bluetooth with only minor changes. You might consider using the Pilot class to move the robot around rather than using all the direct calls to Motor.A and Motor.C.

What sort of comments were you looking for? How to do things better? Whether it is useful for other people?

You can do this sort of remote control by running the leJOS API directly from the PC. If you do this it uses the Lego Communications Protocol (LCP) to send command to the NXT and you do not need to upload a program to the NXT as the startup menu responds to these commands. However, doing it the way you have done it is better as you can control exactly how you want the NXT program to respond.
lawrie
leJOS Team Member
 
Posts: 677
Joined: Mon Feb 05, 2007 1:27 pm

Postby SpikeT » Sat Oct 03, 2009 10:01 pm

That was exactly my plan to control a robot in detail. By uploading the program to NXT brick I can have it send & receive data from PC (that what I thought anyway).

I did this setup in USB mode because some people
might not have a Bluetooth dongle on hand.
Also the whole Bluetooth concept mightbe a bit hard
at first for a new users.

For those who want to connect to the brick with PC via Bluetooth,
you just need to edit couple things.

form:

if (!link.connectTo("usb://"))

to:

if (!link.connectTo("btspp://"))


and on NXT brick side

from:

public static void connect()
{
System.out.println("Listening");
USBLink = USB.waitForConnection();
dataOut = USBLink.openDataOutputStream();
dataIn = USBLink.openDataInputStream();

}//End connect

to:

public static void connect()
{
System.out.println("Listening");
BTLink = Bluetooth.waitForConnection();
dataOut = BTLink.openDataOutputStream();
dataIn = BTLink.openDataInputStream();

}//End connect
SpikeT
New User
 
Posts: 19
Joined: Tue Sep 22, 2009 3:44 am

Question.

Postby ryainad » Fri Feb 04, 2011 11:17 pm

Thank you for providing the code. I'm new user of Lego. I've tried this program.

When connect it via USB it's working properly.
But when I connect it via bluetooth. It's running and connects to brick, but it prints onto brick:"IO Exception readInt" and when I click buttons it does'n get commands.

Do you have any ideas?

Thank you in advance ...
ryainad
New User
 
Posts: 10
Joined: Wed Feb 02, 2011 5:29 pm
Location: Almaty

Postby vonderseite » Wed Feb 09, 2011 8:46 pm

I also appreciate your putting the code here, since I wanted to do a similar thing and did not know from where to start.

However, since I did not get USBSend and USBRecieve running on my MacBook, I only tried it via bluetooth and got the same IOExceptions on the NXT.

Would be nice to get this fixed. Any idea?

@lawrie: Could you give me a hint on how I can use LCP?
Maybe starting from BTSend and BTRecieve (which work just fine). What do I need to to, to use the pilotclass on the Computer and steer the NXT with it?

Thanks
vonderseite
New User
 
Posts: 3
Joined: Tue Feb 08, 2011 1:16 pm

Postby gloomyandy » Thu Feb 10, 2011 3:18 pm

Hi Folks,
I finally had some time to try this out. It looks like there is a bug in our PC side comms code. If you use flush on a stream that has no pending data, we end up sending a zero length packet. This packet is used as an end of file marker and so the NXT will generate EOFExceptions... So either you can fix it by only calling flush if you have written data to the connection (not easy to do). Or you can try an updated pccomm.jar. I didn't have time to test this fix with the release version, but I think it should work. What you need to do is...
1. download this file www.gloomy-place.com/lejos/pccomm.jar
2. Locate all instances of pccomm.jar on your system and rename them to be pccomm.jar.old.
3. Place a copy of the new jar in place of the renamed file.
4. Test your program.

Please let me know how you get on...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Thank you!

Postby ryainad » Sat Feb 12, 2011 10:42 pm

Andy! Thank you!!!

I spent 4 nights to fix this problem!!! and gave it up! :o

Now I can sleep with a clean heart ...

It is working !!!! :lol:
ryainad
New User
 
Posts: 10
Joined: Wed Feb 02, 2011 5:29 pm
Location: Almaty

Postby gloomyandy » Sat Feb 12, 2011 11:14 pm

Hi,
Great to hear you have it working. Thanks for trying this and sticking with it to help us work out what was going on...

All the best

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Program sample using PC to control NXT via USB and Bluet

Postby TheTedinator » Sun Jan 08, 2012 10:13 pm

Is this the best way to control the nxt from the PC? Sending integer codes for different commands?
TheTedinator
New User
 
Posts: 5
Joined: Sat Dec 31, 2011 2:13 am

Re: Program sample using PC to control NXT via USB and Bluet

Postby gloomyandy » Sun Jan 08, 2012 10:25 pm

Well there are lots of ways to do this sort of thing. Basically you are designing a simple communications protocol. Sending ints is easy to do, you oculd take things much further and send some sort of command packet with details of speed and much more. Similarly you may have the NXT reporting data back to the PC (speed, sensor state, estimated location, whatever). Alternately you might choose to use a text based protocol (even going as far as something like xml), this will be more verbose, but may be easier to debug, and extend. At the end of the day it comes down to what it is you want to do and how complex you want to make it. There probably is no "best way".

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Program sample using PC to control NXT via USB and Bluet

Postby TheTedinator » Mon Jan 09, 2012 5:57 am

BY command packet do you mean making some sort of object instance and sending it via bluetooth? Would something more complex be significantly slower? Uploading a smallish program via bluetooth takes about 10x as long as by USB on my mac?
TheTedinator
New User
 
Posts: 5
Joined: Sat Dec 31, 2011 2:13 am

Re: Program sample using PC to control NXT via USB and Bluet

Postby gloomyandy » Mon Jan 09, 2012 10:28 am

No, I really mean just a collection of ints (or whatever) rather than just a single one. basically performing hand serialization/deserialization of the data. leJOS does not currently support serialization in most of its classes, and certainly does not support serialization of arbitrary objects (which something like RMI might use), as this requires reflection and dynamic object loading which is not supported.

As to the speed difference of the two transports this is probably not the best thread to discus this (there is another active thread at the moment talking about Mac Bluetooth performance here: viewtopic.php?f=7&t=3073), but there are a couple of things to remember. A program upload requires the establishment of the connection followed by the actual data transfer. On a Windows PC the connection establishment for Bluetooth takes much longer than for USB, the data transfer part is certainly slower, but the actual transfer speed is still pretty fast (approx 20K bytes/Sec), which is usually sufficient for most remote control applications. Some actual data on this is in this thread here:
viewtopic.php?f=6&t=1331&hilit=bluetooth+performance
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Program sample using PC to control NXT via USB and Bluet

Postby Maliky » Wed Mar 07, 2012 1:05 am

hello
it 's really a great and helpful code... i am new in programming using lejos
so when i try to run the program
the nxt code upload very nicely ... but when i try to run the ... pc code it chose problem .. so i am really hop u could tell me whats wrong

MY LEJOES VERSION :- leJOS_NXJ_0.9.1beta-1_win32

AND THE ECLIPSE VERSION :- eclipse-java-indigo-SR2-win32

and her the error message

Code: Select all
Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problem:
   The method getDataOut() is undefined for the type NXTConnector

   at NXTremoteControl_TA.connect(NXTremoteControl_TA.java:244)
   at NXTremoteControl_TA$ButtonHandler.actionPerformed(NXTremoteControl_TA.java:134)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at NXTremoteControl_TA$ButtonHandler.mousePressed(NXTremoteControl_TA.java:159)
   at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at NXTremoteControl_TA$ButtonHandler.actionPerformed(NXTremoteControl_TA.java:139)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
   at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at NXTremoteControl_TA$ButtonHandler.mousePressed(NXTremoteControl_TA.java:165)
   at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at NXTremoteControl_TA$ButtonHandler.actionPerformed(NXTremoteControl_TA.java:139)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
   at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at NXTremoteControl_TA$ButtonHandler.mousePressed(NXTremoteControl_TA.java:165)
   at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at NXTremoteControl_TA$ButtonHandler.actionPerformed(NXTremoteControl_TA.java:139)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
   at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at NXTremoteControl_TA$ButtonHandler.mousePressed(NXTremoteControl_TA.java:165)
   at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at NXTremoteControl_TA$ButtonHandler.actionPerformed(NXTremoteControl_TA.java:139)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
   at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at NXTremoteControl_TA$ButtonHandler.mousePressed(NXTremoteControl_TA.java:165)
   at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at NXTremoteControl_TA$ButtonHandler.actionPerformed(NXTremoteControl_TA.java:139)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
   at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at NXTremoteControl_TA$ButtonHandler.mousePressed(NXTremoteControl_TA.java:158)
   at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at NXTremoteControl_TA$ButtonHandler.actionPerformed(NXTremoteControl_TA.java:139)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
   at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at NXTremoteControl_TA$ButtonHandler.mousePressed(NXTremoteControl_TA.java:161)

than you
Maliky
New User
 
Posts: 11
Joined: Tue Mar 06, 2012 1:33 am

Re: Program sample using PC to control NXT via USB and Bluet

Postby Maliky » Wed Mar 07, 2012 11:08 am

ANY ONE CAN HELP ME :(
Maliky
New User
 
Posts: 11
Joined: Tue Mar 06, 2012 1:33 am

Next

Return to NXJ Projects

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff