read a count from serial

hi all. here the thing i have a sensor witch is reading RPM from a motor about 8000rpm is top speed, but i want to use this rpm to calculate HP i know the math but my issue is read the data and set it in a program that will calculate HP and also graph rpm x HP..... also the reading have to be in real time...

how could i do this????

the pc program is not written but i intend to do it using netbeans(im not good programming but this would help me out)