public void resizePanel(int w, int h) {
        if (w == 0 && h == 0) {
            //full screen
            Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
            pWidth = dim.width;
            pHeight = dim.height;

            dbImage = null;

            //resize the panel
            this.setPreferredSize(new Dimension(pWidth, pHeight));
            this.revalidate();
            this.setFocusable(true);
            this.requestFocus();

            //resize the container
            if (container != null) {
                container.setPreferredSize(new Dimension(pWidth, pHeight));
                container.validate();
            }
        } else {
            pWidth = w;
            pHeight = h;

            dbImage = null;

            game.setFullScreen(false);

            //resize the panel
            this.setPreferredSize(new Dimension(pWidth - 10, pHeight - 6));
            this.revalidate();
            this.setFocusable(true);
            this.requestFocus();

            //resize the container
            if (container != null) {
                container.setPreferredSize(new Dimension(pWidth - 10, pHeight - 6));
                container.validate();
            }
        }

        //resize the frame
        game.pack();
        game.setLocationRelativeTo(null);

        if (w == 0 && h == 0) {
            //full screen
            game.setFullScreen(true);
        }
    }