java国际化教程及源代码,可以看一下。
源代码在线查看: class-schedule2.java
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.util.*;
public class class-schedule2 extends Frame {
public class-schedule2() {
this(null);
}
public class-schedule2(Locale locale) {
super("Java Training");
if (locale == null)
locale = getLocale();
Image im = getToolkit().getImage(getClass().getResource("SMarea.gif"));
image-canvas ic = new image-canvas(im);
ResourceBundle labels = ResourceBundle.getBundle("training-labels-bundle", locale);
Panel p = new Panel(new GridLayout(3, 2));
p.add(new Label(labels.getString("Date")));
p.add(new Label("6/3/98"));
p.add(new Label(labels.getString("Cost")));
p.add(new Label("$1,200.00"));
p.add(new Label(labels.getString("Location")));
p.add(new Label("San Mateo, CA"));
add(new Label(labels.getString("Title"), Label.CENTER), BorderLayout.NORTH);
add(p, BorderLayout.SOUTH);
ScrollPane sp = new ScrollPane();
sp.add(ic);
add(sp, BorderLayout.CENTER);
setSize(300, 250);
}
public static void main(String[] args) {
Frame f = new class-schedule2();
f.addWindowListener(
new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
}
);
f.setVisible(true);
}
}