SDK JAVA

SDK JAVA

Hello everybody,

I think it is time to start the first SDK JAVA thread. And here comes the first question:
How can I add a CameraButtonClickedEventListener in the CameraDemoJava application.
In the constructor CameraDemoJava() I have added
b = new Buttons(cameraFrame);
When I now add the CameraButtonClickedEventListener the same way that it is done in the ButtonDemoJava application
b.addCameraButtonClickedEventListener(cameraClickedEL = new ICameraButtonClickedEventListener(){
public void cameraButtonClicked(CameraButtonClickEvent evt) {
String message = "Camera Button was pressed";
JOptionPane.showMessageDialog(CameraFrame, message, "Dialog",
JOptionPane.INFORMATION_MESSAGE);

}

});

I recieve an error:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: unable to register button callback.btnType
at com.intel.healthcare.button.Buttons.doRegisterActionCallbackNoData(Buttons.java:2269)
at com.intel.healthcare.button.Buttons.addCameraButtonClickedEventListener(Buttons.java:1106)
at CameraDemo.CameraDemoJava.actionPerformed(CameraDemoJava.java:345)
The MCA log file in the emp folder says
{S0-P2128-T1352} [BN] Button_Local::RegisterAction - Invalid Window Handle passed
{S0-P2128-T1352} [BN] BN_RegisterAction returning unsuccessful status of : ;DATA#-220

Is there anybody who knows how to add a CameraButtonClickedEventListener ?

Thanks
Markster

4 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Hello everybody

I found out.
You cannot call b = new Button(CameraFrame) in the constructor CameraDemoJava().
because of the Invalid Window Handle - CameraFrame is declared static
Now I declared button as
static static Buttons b;

And in private static void createAndShowGUI(){
...
b = new Buttons(cameraFrame);
...
}
Now I can Start the Preview and Capture Frame by pressing the Camera Button
Okay this was not a SDK problem but Thanks anyway

Markster

Hello Steve,

I found a small error in the Example Camera Java application. It is nothing serious.
When Changing the Option ComboBox to one of the camera options the slider will change this option.
But when the Option ComboBox is changed to "Select an option" the Option Slider is still enabled. So when the Option Slider is changed an error will occur.
Exception:
ArrayIndexOutOfBoundsException

The simpliest way to avoid this error, is to disable the slider when the Option ComboBox is set on "Select an option"
So nothing serious, but I just wanted to let you know

Greetings
Markster

Ritratto di Steven Murray (Intel)

Thanks Markster. I'll forward it to our developers.

-Steve

Accedere per lasciare un commento.