これは私のJavaクラスで、NumberFormatException
. 誰でも私を助けることができますか?何度も試しましたが、そのエラーが引き続き発生します。
public class HelloFromHTML extends JApplet
{
String name;
String age, dimensions1 ,dimensions2;
int num;
Font f;
public void init()
{
f = new Font("TimesRoman", Font.BOLD,30);
String a = this.getParameter("ageHTML");
num = Integer.parseInt(a);
name = "Hello " + getParameter("nameHTML") + " " + num + " years'";
dimensions1 = "JApplet size is " + getParameter("width") + ", " + getParameter("height");
dimensions2 = "size is " + String.valueOf(getWidth()) + ", " + String.valueOf(getHeight());
}
public void paint(Graphics g)
{
super.paint(g);
g.setFont(f);
g.setColor(Color.black);
//////////////////////////////////
// Display String
g.drawString(name,5,50);
g.drawString(dimensions1,5,100);
g.drawString(dimensions2,5,200);
}
}