Sample Java code for GUI interface