I am developing an application which monitors the presence of the power supply of the laptop. If there is a power cut or restoration it will intimate me over email. It will
A quick google search turns up a java acpi library on sourceforge. Hasn't been updated since 2004 though.