reading COM port value and printing in textArea which located inside the panel in java

故事扮演 提交于 2020-01-11 12:38:06

问题


I have to read a COM port and the data should be displayed inside the TextArea dynamically (data will come every minute), which I have created inside JPanel.

Advance Thanks for reply.


回答1:


Some leads:

  • java2s has some examples.
  • this CommPortOpen class can give you a good start.



回答2:


For reading from the serial port, have a look at the javacomm API here: http://java.sun.com/products/javacomm/

The User's Guide has more information and some example code: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html




回答3:


For a multi-platform application, look into rxtx.

javax.comm has not had active development for a number of years. The rxtx project has a compatible api as well as a more feature rich gnu package API.

There are examples with the source code and in the Wiki.



来源:https://stackoverflow.com/questions/348777/reading-com-port-value-and-printing-in-textarea-which-located-inside-the-panel-i

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!