Java in 21 Days, Sams Teach Yourself (Covering Java 8) by Cadenhead Rogers

Java in 21 Days, Sams Teach Yourself (Covering Java 8) by Cadenhead Rogers

Author:Cadenhead, Rogers [Cadenhead, Rogers]
Language: eng
Format: azw3, epub
Publisher: Pearson Education
Published: 2015-12-29T16:00:00+00:00


public void focusLost(FocusEvent event) {

// ...

}

To determine which object gained or lost the focus, the getSource() method can be called on the FocusEvent object sent as an argument to the two methods.

Listing 12.2 contains Calculator, a Java application that displays the sum of two numbers. Focus events are used to determine when the sum needs to be recalculated. In NetBeans create a new Java file with the name Calculator and package name com.java21days with the source code of this listing.

LISTING 12.2 The Full Text of Calculator.java

Click here to view code image



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.