TreasureMap
本文导语: TreasureMap 是一个 Java 类库,提供了 JSR-296 (Swing Application Framework) 的 ResourceMap 实现。 示例代码: package com.foobar; import java.util.Locale; import com.dteoh.treasuremap.ResourceMaps; import org.jdesktop.application.ResourceMap; class Foo { // Create a Resour...
TreasureMap 是一个 Java 类库,提供了 JSR-296 (Swing Application Framework) 的 ResourceMap 实现。
示例代码:
package com.foobar;
import java.util.Locale;
import com.dteoh.treasuremap.ResourceMaps;
import org.jdesktop.application.ResourceMap;
class Foo {
// Create a ResourceMap for Foo only
ResourceMap rMap = new ResourceMaps(Foo.class).build();
// Create a ResourceMap for Bar with Foo's map as the parent
ResourceMap rMap2 = new ResourceMaps(Bar.class).withParent(rMap).build();
// Create a ResourceMap for Foo and Bar all in one
ResourceMap rMapFB = new ResourceMaps(Foo.class).and(Bar.class).build();
// Create a ResourceMap for RainbowA and RainbowB with a parent map
ResourceMap rMapWhoa = new ResourceMaps(RainbowA.class).and(RainbowB.class).withParent(rMapFB).build();
// Create a ResourceMap for the "ABC" Locale
ResourceMap rMap = new ResourceMaps(Foo.class, new Locale("ABC")).build();
}
您可能感兴趣的文章:
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。