any applet has a reasonable chance of deadlocking on startup... but
the applet shown below repros the problem quite often with appletviewer_g:
import java.applet.*;
import java.awt.*;
class Foo extends Canvas
{
public void paint(Graphics g)
{
for (int i = 0; i < 255; i += 2)
{
g.setColor(new Color(i, 0, 0));
g.drawString("this is a test of foo", i, i);
}
}
public Dimension getPreferredSize()
{
return new Dimension(100, 100);
}
public Dimension getMinimumSize()
{
return getPreferredSize();
}
}
public class test extends Applet
{
public void init()
{
setLayout(new FlowLayout());
add(new Foo());
add(new Foo());
add(new Foo());
}
}
the applet shown below repros the problem quite often with appletviewer_g:
import java.applet.*;
import java.awt.*;
class Foo extends Canvas
{
public void paint(Graphics g)
{
for (int i = 0; i < 255; i += 2)
{
g.setColor(new Color(i, 0, 0));
g.drawString("this is a test of foo", i, i);
}
}
public Dimension getPreferredSize()
{
return new Dimension(100, 100);
}
public Dimension getMinimumSize()
{
return getPreferredSize();
}
}
public class test extends Applet
{
public void init()
{
setLayout(new FlowLayout());
add(new Foo());
add(new Foo());
add(new Foo());
}
}