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!

Just realized resizing goes under init().

setSize(500, 500);

It works now!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.