本文整理汇总了Java中com.jgoodies.looks.plastic.PlasticLookAndFeel.setPlasticTheme方法的典型用法代码示例。如果您正苦于以下问题:Java PlasticLookAndFeel.setPlasticTheme方法的具体用法?Java PlasticLookAndFeel.setPlasticTheme怎么用?Java PlasticLookAndFeel.setPlasticTheme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jgoodies.looks.plastic.PlasticLookAndFeel
的用法示例。
在下文中一共展示了PlasticLookAndFeel.setPlasticTheme方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
public static void main(String[] args)
{
LOGGER.info("Starting JFreeStock version: " + VERSION);
try
{
PlasticLookAndFeel.setPlasticTheme(new Silver());
UIManager.setLookAndFeel(new PlasticXPLookAndFeel());
}
catch (Exception e)
{
LOGGER.error("Failed to set look and feel", e);
System.exit(1);
}
JFreeStockFrame frame = new JFreeStockFrame();
frame.setVisible(true);
}
示例2: setLookAndTheme
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
public static void setLookAndTheme(LookAndFeel laf, Object theme)
/* 134: */ throws UnsupportedLookAndFeelException
/* 135: */ {
/* 136:419 */ if (((laf instanceof PlasticLookAndFeel)) && (theme != null) && ((theme instanceof PlasticTheme))) {
/* 137:422 */ PlasticLookAndFeel.setPlasticTheme((PlasticTheme)theme);
/* 138: */ }
/* 139:424 */ UIManager.setLookAndFeel(laf);
/* 140: */ }
示例3: setLookAndFeel
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
/**
* Sets the look and feel to the default utilities look and feel. First
* tries to use Nimbus, if Nimbus is not supported then PlasticXPLookAndFeel
* is used.
*
* @exception IOException exception somehow thrown when starting from a zip file
* @return true if the Nimbus look and feel is used, false otherwise
*/
public static boolean setLookAndFeel() throws IOException {
boolean nimbusLookAndFeelFound = false;
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
nimbusLookAndFeelFound = true;
break;
}
}
} catch (Exception e) {
// ignore error, use look and feel below
}
if (!nimbusLookAndFeelFound) {
try {
PlasticLookAndFeel.setPlasticTheme(new SkyKrupp());
UIManager.setLookAndFeel(new PlasticXPLookAndFeel());
} catch (Exception ex) {
// this should not be possible...
// use default look and feel
}
}
return nimbusLookAndFeelFound;
}
示例4: setLookAndFeel
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
/**
* Sets the look and feel. First tries to use Nimbus, if Nimbus is not
* supported then PlasticXPLookAndFeel is used.
*
* @return true if the Nimbus look and feel is used, false otherwise
*/
public static boolean setLookAndFeel() {
boolean nimbusLookAndFeelFound = false;
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
nimbusLookAndFeelFound = true;
break;
}
}
} catch (Exception e) {
// ignore error, use look and feel below
}
if (!nimbusLookAndFeelFound) {
try {
PlasticLookAndFeel.setPlasticTheme(new SkyKrupp());
UIManager.setLookAndFeel(new PlasticXPLookAndFeel());
} catch (UnsupportedLookAndFeelException ex) {
// this should not be possible...
}
}
return nimbusLookAndFeelFound;
}
示例5: configureUI
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
private void configureUI() {
Options.setDefaultIconSize(new Dimension(18, 18));
Options.setUseNarrowButtons(this.settings.isUseNarrowButtons());
Options.setTabIconsEnabled(this.settings.isTabIconsEnabled());
UIManager.put("jgoodies.popupDropShadowEnabled", this.settings
.isPopupDropShadowEnabled());
LookAndFeel selectedLaf = this.settings.getSelectedLookAndFeel();
if ((selectedLaf instanceof PlasticLookAndFeel)) {
PlasticLookAndFeel
.setPlasticTheme(this.settings.getSelectedTheme());
PlasticLookAndFeel.setTabStyle(this.settings.getPlasticTabStyle());
PlasticLookAndFeel.setHighContrastFocusColorsEnabled(this.settings
.isPlasticHighContrastFocusEnabled());
} else if (selectedLaf.getClass() == MetalLookAndFeel.class) {
MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
}
JRadioButton radio = new JRadioButton();
radio.getUI().uninstallUI(radio);
JCheckBox checkBox = new JCheckBox();
checkBox.getUI().uninstallUI(checkBox);
try {
UIManager.setLookAndFeel(selectedLaf);
} catch (Exception e) {
System.out.println("Can't change L&F: " + e);
}
}
示例6: setLookAndTheme
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
public static void setLookAndTheme(LookAndFeel laf, Object theme)
throws UnsupportedLookAndFeelException {
if (laf instanceof PlasticLookAndFeel
&& theme != null
&& theme instanceof PlasticTheme) {
PlasticLookAndFeel.setPlasticTheme((PlasticTheme) theme);
}
UIManager.setLookAndFeel(laf);
}
示例7: initLookAndFeel
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
private void initLookAndFeel()
{
String osName = System.getProperty( "os.name" ).toUpperCase();
// set to use swing anti alias text only for JVM <= 1.5
System.setProperty( "swing.aatext", "true" );
// set default swing bold to false, only for JVM 1.5 or above
UIManager.put( "swing.boldMetal", Boolean.FALSE );
// set LaF
LookAndFeel lnf = UIManager.getLookAndFeel();
if( lnf != null && lnf.getID().equalsIgnoreCase( "Metal" ) )
{
final String lnfClassName;
if( osName.startsWith( "MAC" ) )
{
System.setProperty( "com.apple.mrj.application.apple.menu.about.name", "Envisage" ); //TODO i18n
System.setProperty( "apple.laf.useScreenMenuBar", "true" );
lnfClassName = UIManager.getSystemLookAndFeelClassName();
}
else if( osName.startsWith( "WINDOWS" ) )
{
UIManager.put( "ClassLoader", LookUtils.class.getClassLoader() );
lnfClassName = Options.getSystemLookAndFeelClassName();
Options.setUseNarrowButtons( false );
}
else
{
UIManager.put( "ClassLoader", LookUtils.class.getClassLoader() );
lnfClassName = Options.getCrossPlatformLookAndFeelClassName();
PlasticLookAndFeel.setTabStyle( PlasticLookAndFeel.TAB_STYLE_METAL_VALUE );
PlasticLookAndFeel.setPlasticTheme( new ExperienceBlue() );
Options.setUseNarrowButtons( false );
//PlasticLookAndFeel.setMyCurrentTheme(new ExperienceBlueDefaultFont()); // for CJK Font
}
if( lnfClassName != null )
{
try
{
UIManager.setLookAndFeel( lnfClassName );
}
catch( ClassNotFoundException | IllegalAccessException | InstantiationException |
UnsupportedLookAndFeelException ex )
{
System.err.println( "Unable to set LookAndFeel, use default LookAndFeel.\n" + ex.getMessage() );
}
}
}
}
示例8: setTheme
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
/**
* @param theme PlasticTheme to use.
* @see com.jgoodies.looks.plastic.PlasticLookAndFeel#setPlasticTheme(com.jgoodies.looks.plastic.PlasticTheme)
*/
public void setTheme(PlasticTheme theme) {
PlasticLookAndFeel.setPlasticTheme(theme);
}