private Point get_center(int w, int h, boolean frame)
    {
        Point point = null;
        double width;
        double height;
        if (frame)
        {
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            width = screenSize.getWidth();
            height = screenSize.getHeight();
        } else
        {
            width = this.getWidth();
            height = this.getHeight();
        }

        int with_r = (int) (width / 2 - w / 2);
        int height_r = (int) (height / 2 - h / 2);
        if (!frame)
        {
            with_r = (int) (with_r + getLocation().getX());
            height_r = (int) (height_r + getLocation().getY());
        }
        point = new Point(with_r, height_r);
        return point;
    }