aghosh
aghosh

Reputation: 1

Applet - Serialport communication

I'm trying to create a simple Java applet that reads data coming in through a serial port. Is it possible?

Upvotes: 0

Views: 4933

Answers (3)

scream3r
scream3r

Reputation: 216

For that you can use jSSC lib (Java Simple Serial Connector). Page on google code: http://code.google.com/p/java-simple-serial-connector/

Also see this page: http://code.google.com/p/java-simple-serial-connector/wiki/jSSC_Terminal

This is jSSC based serial port terminal applet. Source code of jSSC-Terminal you can download on "Downloads" page.

Best regards, Sokolov Alexey.

Upvotes: 1

Andrew Thompson
Andrew Thompson

Reputation: 168825

Yes, it is possible. Having said that, I think @andri pointed out the best path to a solution.

Upvotes: 1

andri
andri

Reputation: 11292

By default, Java has no support for communicating with serial ports. There are libraries like RXTX that allow you to do that, but unfortunately RXTX requires a platform-specific native library in order to use the serial ports.

Further complication is that Java applets run in a very restricted sandbox by default, which means you need to a) sign the applet and b) manually install the necessary RXTX libraries on the host computer, which is not that user-friendly.

An alternative solution is discussed in this SO question (in short: use Java Web Start, not an applet, and everything gets a lot easier).

Upvotes: 3

Related Questions