public class programresources_de extends programresources
{
public object handlegetobject(stirng key)
{
if (key.equals(button))
return rechnen;
else if (key.equals(backcolor))
return color.black;
else if (key.equals(defaultsie))
return new double[] {210, 297};
}
}
public class programresources_en_us extends programresources
{
public object handlegetobject(stirng key)
{
if (key.equals(button))
return compute;
else if (key.equals(backcolor))
return color.blue;
else if (key.equals(defaultsie))
return new double[] {216, 279};
}
}
使用listresourcebundle类,你可以将自己的所有资源放入一个对象数组中,然后它能够为你进行资源的查找:
public class programresources_de extends listresourcebundle
{
public object [][] getcontents() {return contents; }