A method for controlling an image forming apparatus capable of running a predetermined application program on a framework operating with a virtual machine, which includes an operation or input receiver, a timer configured to count a non-operation time in which an operation using the operation or input receiver is not performed, a memory configured to store instructions and a user interface program which clears the non-operation time counted by the timer and initializes display of the operation or input receiver in accordance with an elapse of a predetermined time in the non-operation time, in which the method is caused when a processor provided in the image forming apparatus executes the instructions, the method comprising the operations of:
- notifying the framework and the user interface program in accordance that the user operation via the operation or input receiver is received while the predetermined application program is running so that the user interface program does not initialize the display of the operation or input receiver by clearing the non-operation time counted by the timer in a case where the user operation is received before the time counts the predetermined time;
- and
- notifying the user interface program in accordance that the user operation via the operation or input receiver is received while the predetermined application program is not running.