正方形の周長 #21
リソース読み込み用のクラスSquareParametersResをUTF-8のプロパティファイルベースに変更する。
といっても、デフォルトコントロールをPropertiesControlに変更するだけである。
...snip public class SquareParametersRes { private static ResourceBundle resources = ResourceBundle.getBundle("SquareParametersResources", new PropertiesControl()); public static String get(String key) { ...snip
そして、日本語リソースファイルSquareParametersResources_ja.propertiesをUnicodeエスケープせず、UTF-8で保存する。
もちろん、Unicodeエスケープ後の従来のものであっても構わない。
SquarePerimeter.java等の他のファイルは変更する必要はない。
これで、JavaアプリケーションベースのSquarePerimeter、アプレットベースのSquarePerimeterAppletともに今までと同様に動作する。