Note that there are some explanatory texts on larger screens.

plurals
  1. POChange selection on static check button java
    primarykey
    data
    text
    <p>I have a bit of a problem. I'm trying to compare a string to an array. The array is built up after receiving strings on a serial line.</p> <p>I use several voids and pass the strings and arrays between them so every thing must be static. </p> <pre><code>// button is set public static Button btnRS_1; // inside Create contense: btnRS_1 = new Button(shlSioMiniTest, SWT.TOGGLE); btnRS_1.setEnabled(false); btnRS_1.setSelection(false);; btnRS_1.setFont(SWTResourceManager.getFont("Tahoma", 10, SWT.NORMAL)); btnRS_1.setBounds(29, 130, 76, 16); btnRS_1.setText("RS232 0"); if (RStest[0].equals("1")){ btnRS_1.setSelection(true); } </code></pre> <p>I get errors. A lot of them too. And if I comment out the <code>setSelection</code> bit and just print out a string to see it works.</p> <pre><code>Exception in thread "Thread-9" org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4361) at org.eclipse.swt.SWT.error(SWT.java:4276) at org.eclipse.swt.SWT.error(SWT.java:4247) at org.eclipse.swt.widgets.Widget.error(Widget.java:468) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:359) at org.eclipse.swt.widgets.Button.setSelection(Button.java:1047) at SioTest.Sio_test.fillChecks(Sio_test.java:604) at SioTest.Sio_test.testParameters(Sio_test.java:592) at SioTest.Sio_test$ProtocolImpl.onMessage(Sio_test.java:968) at SioTest.Sio_test$ProtocolImpl.onReceive(Sio_test.java:946) at SioTest.Sio_test$SerialReader.run(Sio_test.java:882) at java.lang.Thread.run(Unknown Source) </code></pre> <p>Can someone advice me on what to do?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload