Hi,
When you draw something to the screen in a paint() method, you specify some coordinates. But then you have to include a height and width variable in your
applet tag as well.
So how do you know how much the value of either the height or the width parameters should be in the applet tag? For example
import java.awt.Graphics;
import java.applet.Applet;
public class disp extends Applet
{
public void paint(Graphics g)
{
g.drawString("One a clock, two o clock, three a clock rock",10,40);
g.drawRect(1,1,15,80);
}
}
<html>
<head><title></title></head>
<body>
<applet code="paintit.class" height=??? width=""">
</applet>
</body>
</html>
How do i know what the numbers for height and width need to be at the very minimum so that the entire applet is displayed on the screen and not cut off because the applet might be too big to be displayed in the size of the rectangle specified by height and width?