开发者

parallel port programming using java

I want to program my parallel port and send data to it,i have done this successfully using C+Ubuntu combination ,now I want to add GUI forms in the program so I am using java for the same,So can anyone let me know which library should 开发者_开发问答I use for interfacing ports(parallel and serial) using java.The "comm.jar" is the one available but there are no updates in that lib since long...(I am preferring parallel port over serial port). Thanks in advance...


You've found RXTX?


import java.io.FileOutputStream;
import java.io.PrintStream;

    public class MyClass {
        public static void main(String[] args) {
            FileOutputStream fs = new FileOutputStream("LPT1:");
            PrintStream ps = new PrintStream(fs);

            ps.println("Hello World!");
            ps.flush();
            ps.close();
            fs.close();
        }
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜