I want to make a battery meter for my computers, which all work on different OSs. I figured the best way would be in Java. Is there any way to do this WITHOUT external libraries? All it needs to do is show the battery level in a java.swing.JProgressBar.
I want to make a battery meter for my computers, which all work on
Share
No, there is no way to do this just using the standard JDK. It is up to the OS to expose details about the current power/battery state, and there is no built-in way to access this information in Java. To do what you want will require at least some external libraries, and almost certainly JNI as well.