The Swing Timer class could be used to call a method to set the boolean to false after a given length of time.