Today i am going to show you how to create a system temperature monitor program in JavaFX. This program use Line Chart from JavaFX library. In order to get the temperature readings, i have given a connection to the system terminal so that i can execute terminal commands within the Java program itself.
Process proc = Runtime.getRuntime().exec("sensors"); BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()));
This code will create a new process and will attach to the ‘sensors’ command. This program will work only on linux and the number of temperature readings will change from system to system. Using the process’s input stream we can read the output of the command passed through a Buffered Reader.
After the establishment of connection with sensors, I have added an infinite loop with 1000ms sleep so that the temperature information will be updated each second. The returned data from process is taken and matched with a pattern [+]…. which will help to select the required temperature information alone. For this purpose, i have made use of Matcher and Pattern class in standard Java Library.
If you are not familiar with JavaFX line graphs, i recommend reading this article How to Add JavaFX Charts / Graphs Tutorial.
The processed data is then associated with 4 streams of XYData.Series() data structure to represent 4 different lines on the graph. Extensive CSS styling is used in this program to illustrate the capability of CSS to improve the look and feel of program (if it did :-)). The animations that can be seen on the video is the primitive animation associated with JavaFX LineChart.
Watch the development in Action. Subscribe for more programs and tutorials
… [Trackback]
[…] There you will find 41244 additional Information to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Information on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Read More on on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] There you will find 213 additional Information to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Read More here to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More Info here on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More here to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More Information here on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] There you will find 67099 more Information on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Read More on to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Read More here to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More here on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More here on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More on on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Read More on to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Information to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Read More on on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More Info here on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Here you can find 17708 more Information to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More here on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Read More on to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More Information here to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More Info here on that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]
… [Trackback]
[…] Find More to that Topic: genuinecoder.com/temperature-monitor-prorgam-using-javafx-html/ […]