0

I was given a font finder program, but I need to resize the applet... any suggestions on where and what code is needed to fit the applet to a specific size? If not, is there a setting in eclipse that will work?

public Dimension getPreferredSize() {
        return new Dimension(800,800);// this will not resize the applet
    }

    public void paintComponent(Graphics g) {
        int x = getWidth()/2 - metrics.stringWidth(text)/2;// this will not resize the applet
        int y = getHeight() - 80; // this will not resize the applet
    }
}

Thanks!

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by abbyo
0

Just realized resizing goes under init().

setSize(500, 500);

It works now!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.