• Creating a Window

    To create a window, where all the elements of the game are draw, we use the window class of JPlay package.

    The class constructor is as follows:


    In the place of "width" we put the value of the window width in pixels.
    In the place of "height" we put the value of the window height in pixels.

    Note: Everytime we create a game using JPlay, we must first create a window and then, all the other components of the game. This procedure is obligatory, if not made several execution errors will occur.

    Example: Create and display a borderless window with gray color

    UFF - Universidade Federal Fluminense - Institudo de Computação - Ciência da Computação