Count a window active time

Report a typo

Override a method of ActiveTimeCounterWindowAdapter that counts a number of window activations.

To store the number use activationCounter field.

Write a program in Java 17
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

class ActiveTimeCounterWindowAdapter extends WindowAdapter {
private long activationCounter = 0; // do not change it

// override a method
}
___

Create a free account to access the full topic