Results 1 to 6 of 6
- 05-17-2011, 12:25 PM #1
Member
- Join Date
- May 2011
- Posts
- 3
- Rep Power
- 0
GIOVYNET Java Serial Comm event listener
Hi all,
I'm using Giovynet drivers to manage serial port communication with Java for windows.
I'm trying to read serial port through an event listener but I have problems. I implemented the same example as quick start guide.
I attached the code, I have problems with the red colour word
Please, anyone could help me?
thanks,
import giovynet.serial.ActionListenerReadPort;
import giovynet.serial.Baud;
import giovynet.serial.Buffer;
import giovynet.serial.Com;
import giovynet.serial.Parameters;
public class ListenerRead {
private static Com com1;
public static void main(String[] args)throws {
Parameters param = new Parameters();
param.setPort("COM1");
param.setBaudRate(Baud._9600);
com1 = new Com(param);
com1.addActionListenerReadPort(new ActionListenerReadPort()
{
public void tryActionPerformed(Buffer buffer) {
appendLineTextArea("\n<< ");
for (int i = 0; i < buffer.getBufferInIntegerList().size();
i++) {
System.out.print(buffer.getBufferInIntegerList().g et(i));
}
buffer.bufferClear();
}
public void catchActionPerformed(Exception e) {
com1.close();
}
});
/** Other Routines Thread Main
...
...
...
**/
}
}
- 05-17-2011, 01:58 PM #2
Please copy and paste here the full text of the error messages.I have problems
- 05-17-2011, 02:02 PM #3
Member
- Join Date
- May 2011
- Posts
- 3
- Rep Power
- 0
Error nș 1)
public static void main(String[] args)throws { --->Syntax error on token "throws", ClassType expected after this token
Error nș2)
public void tryActionPerformed(Buffer buffer) {
appendLineTextArea("\n<< "); --------------> (The method appendLineTextArea(String) is undefined for the type new ActionListenerReadPort(){})
Thanks, :)
- 05-17-2011, 02:04 PM #4
If you read the error messages, they explain what the problem is.
Syntax error on token "throws", ClassType expected after this tokenmethod appendLineTextArea(String) is undefined
- 05-17-2011, 02:22 PM #5
Member
- Join Date
- May 2011
- Posts
- 3
- Rep Power
- 0
Yes, of course,
I'm new in Java language and I don't know the way to solve it.
I implemented the same example as here.
http://www.giovynet.com/docs/giovyne...tDriverEng.pdf
Page 7.
I'm using ECLIPSE instead NetBeans, could be a problem?
Thanks,
- 05-17-2011, 02:38 PM #6
Similar Threads
-
how to add event Listener to Image
By shane5317 in forum Java 2DReplies: 3Last Post: 03-13-2011, 11:36 AM -
Serial Comm freeze
By java_dude in forum NetworkingReplies: 3Last Post: 01-13-2011, 10:09 PM -
GIOVYNET Java Serial Comm Port Question
By the_justin in forum New To JavaReplies: 1Last Post: 11-30-2010, 12:13 PM -
JColorChooser modeless - Event Listener problem
By siamino in forum New To JavaReplies: 1Last Post: 04-14-2009, 12:39 AM -
Listener for SWT event
By Java Tip in forum Java TipReplies: 0Last Post: 01-08-2008, 09:04 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks