Y
yawnmoth
Say I have the following applet:
import java.applet.*;
import java.awt.*;
public class Test extends Applet
{
public void start()
{
try
{
add(new Label(getParameter("echo")));
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
Here's how I'm including it:
<applet width="500" height="500" code="Test.class">
<param name="echo" value="hello, world!" />
</applet>
The only problem with this method is that the width and height are
fixed. Is there a way for the width and height to be exactly as big as
they need to be to display the echo parameter, whatever it may be?
Also, would it be possible to change the font of the Label? Or maybe
make it so that you can highlight the Label's text just as you can
normal html?
import java.applet.*;
import java.awt.*;
public class Test extends Applet
{
public void start()
{
try
{
add(new Label(getParameter("echo")));
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
Here's how I'm including it:
<applet width="500" height="500" code="Test.class">
<param name="echo" value="hello, world!" />
</applet>
The only problem with this method is that the width and height are
fixed. Is there a way for the width and height to be exactly as big as
they need to be to display the echo parameter, whatever it may be?
Also, would it be possible to change the font of the Label? Or maybe
make it so that you can highlight the Label's text just as you can
normal html?