Connection of arduino to java Netbeans
To do this, you essentially have to code up a version of the Arduino serial monitor within Java (i.e. write Java code to listen to a serial port and recieve bytes from it).

I found an example that might help you-https://playground.arduino.cc/Interfacing/Java