本文整理汇总了Java中com.jgoodies.looks.plastic.PlasticLookAndFeel类的典型用法代码示例。如果您正苦于以下问题:Java PlasticLookAndFeel类的具体用法?Java PlasticLookAndFeel怎么用?Java PlasticLookAndFeel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlasticLookAndFeel类属于com.jgoodies.looks.plastic包,在下文中一共展示了PlasticLookAndFeel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入依赖的package包/类
/**
* Initial method called by the operation system to execute this program.
*
* @param args
* arguments to the program
*/
public static void main(String[] args) {
try {
/*
* // set SkinLF to execute Skin theSkinToUse =
* SkinLookAndFeel.loadThemePack("aquathemepack.zip");
* SkinLookAndFeel.setSkin(theSkinToUse);
*
* UIManager.setLookAndFeel(new SkinLookAndFeel());
*/
PlasticLookAndFeel.setCurrentTheme(new Silver());
UIManager.setLookAndFeel(new PlasticXPLookAndFeel());
} catch (Exception exc) {
exc.printStackTrace();
}
UIFacade.getInstance().loadUI();
}
示例2: initComponentDefaults
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入依赖的package包/类
/**
* For overwriting Component defaults
* @param table
*/
@Override
protected void initComponentDefaults (final UIDefaults table)
{
super.initComponentDefaults(table);
// ComboBox defaults
final Color c = table.getColor("TextField.background");
table.put("ComboBox.background", c);
table.put("ComboBox.listBackground", c);
// globalqss
final Class<?> lf = com.jgoodies.looks.plastic.PlasticLookAndFeel.class;
table.put("Tree.openIcon", makeIcon(lf, "icons/TreeOpen.gif"));
table.put("Tree.closedIcon", makeIcon(lf, "icons/TreeClosed.gif"));
table.put("Tree.leafIcon", makeIcon(lf, "icons/TreeLeaf.gif"));
}
示例3: MenuBar
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入依赖的package包/类
private MenuBar()
{
putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.BOTH);
putClientProperty(PlasticLookAndFeel.BORDER_STYLE_KEY, BorderStyle.SEPARATOR);
//
// File menu
//
JMenu fileMenu = new JMenu("File");
fileMenu.setMnemonic(java.awt.event.KeyEvent.VK_F);
add(fileMenu);
fileMenu.add(_login);
fileMenu.add(_logout);
if(!System.getProperty("os.name").startsWith("Mac OS"))
{
fileMenu.add(_exit);
}
//
// Help menu
//
JMenu helpMenu = new JMenu("Help");
helpMenu.setMnemonic(java.awt.event.KeyEvent.VK_H);
add(helpMenu);
helpMenu.add(_about);
}
示例4: 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);
}
示例5: createDefault
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入依赖的package包/类
public static Settings createDefault() {
Settings settings = new Settings();
settings.setSelectedLookAndFeel(new PlasticXPLookAndFeel());
settings.setSelectedTheme(PlasticLookAndFeel.createMyDefaultTheme());
settings.setUseNarrowButtons(true);
settings.setTabIconsEnabled(true);
settings.setPlasticTabStyle("default");
settings.setPlasticHighContrastFocusEnabled(false);
settings.setPopupDropShadowEnabled(null);
settings.setMenuBarHeaderStyle(null);
settings.setMenuBarPlasticBorderStyle(null);
settings.setMenuBarWindowsBorderStyle(null);
settings.setMenuBar3DHint(null);
settings.setToolBarHeaderStyle(null);
settings.setToolBarPlasticBorderStyle(null);
settings.setToolBarWindowsBorderStyle(null);
settings.setToolBar3DHint(null);
return settings;
}
示例6: main
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入依赖的package包/类
public static void main(String args[]) {
// set look and feel
PlasticLookAndFeel laf = new Plastic3DLookAndFeel();
PlasticLookAndFeel.setCurrentTheme(new ExperienceBlue());
try {
UIManager.setLookAndFeel(laf);
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
JFrame frame = new JFrame("Wizard Demo");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
Wizard wizard = new Wizard(new WelcomeWizardPanel());
wizard.addWizardListener(new WizardDemo());
frame.setContentPane(wizard);
// frame.pack();
frame.setSize(450, 400);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
示例7: 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: */ }
示例8: 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;
}
示例9: setCurrentTheme
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入依赖的package包/类
/**
* Set Current Theme
* @param theme metal theme
*/
public static void setCurrentTheme (final PlasticTheme theme)
{
if (theme != null)
{
THEME_CURRENT = theme;
PlasticLookAndFeel.setCurrentTheme(THEME_CURRENT);
}
}
示例10: setLookAndFeel
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入依赖的package包/类
/**
* Sets the look and feel for the application
*/
private static void setLookAndFeel() {
PlasticLookAndFeel.setMyCurrentTheme(new Silver());
try {
UIManager.setLookAndFeel(new PlasticXPLookAndFeel());
} catch (Exception e) {
}
}
示例11: init
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入依赖的package包/类
/**
* Initialize the toolbar
*/
protected void init() {
setOpaque(false);
setBorder(BorderFactory.createEmptyBorder());
setFloatable(false);
setMargin(new Insets(0, 0, 0, 0));
putClientProperty("JToolBar.isRollover", Boolean.TRUE);
putClientProperty(PlasticLookAndFeel.IS_3D_KEY, Boolean.FALSE);
}
示例12: initializeLookAndFeels
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入依赖的package包/类
/**
* Installs the JGoodies Look & Feels, if available, in classpath.
*/
public final void initializeLookAndFeels() {
// if in classpath thry to load JGoodies Plastic Look & Feel
try {
LookAndFeelInfo[] lnfs = UIManager.getInstalledLookAndFeels();
boolean found = false;
for (int i = 0; i < lnfs.length; i++) {
if (lnfs[i].getName().equals("JGoodies Plastic 3D")) {
found = true;
}
}
if (!found) {
UIManager.installLookAndFeel("JGoodies Plastic 3D",
"com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
}
String os = System.getProperty("os.name");
FontSet fontSet = null;
if (os.startsWith("Windows")) {
fontSet = FontSets.createDefaultFontSet(new Font(
"arial unicode MS", Font.PLAIN, 12));
} else {
fontSet = FontSets.createDefaultFontSet(new Font(
"arial unicode", Font.PLAIN, 12));
}
FontPolicy fixedPolicy = FontPolicies.createFixedPolicy(fontSet);
PlasticLookAndFeel.setFontPolicy(fixedPolicy);
UIManager
.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
} catch (Throwable t) {
try {
UIManager.setLookAndFeel(UIManager
.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例13: init
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入依赖的package包/类
/**
* Initialize the toolbar
*/
protected void init()
{
setOpaque(false);
setBorder(BorderFactory.createEmptyBorder());
setFloatable(false);
setMargin(new Insets(0, 0, 0, 0));
putClientProperty("JToolBar.isRollover", Boolean.TRUE);
putClientProperty(PlasticLookAndFeel.IS_3D_KEY, Boolean.FALSE);
}
示例14: 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;
}
示例15: initializeLookAndFeels
import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入依赖的package包/类
/**
* Installs the JGoodies Look & Feels, if available, in classpath.
*/
static public final void initializeLookAndFeels() {
// if in classpath try to load JGoodies Plastic Look & Feel
try {
LookAndFeelInfo[] lnfs = UIManager.getInstalledLookAndFeels();
boolean found = false;
for (int i = 0; i < lnfs.length; i++) {
if (lnfs[i].getName().equals("JGoodies Plastic 3D")) {
found = true;
}
}
if (!found) {
UIManager.installLookAndFeel("JGoodies Plastic 3D",
"com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
}
String os = System.getProperty("os.name");
FontSet fontSet = null;
if (os.startsWith("Windows")) {
fontSet = FontSets.createDefaultFontSet(new Font(
"arial unicode MS", Font.PLAIN, 12));
} else {
fontSet = FontSets.createDefaultFontSet(new Font(
"arial unicode", Font.PLAIN, 12));
}
FontPolicy fixedPolicy = FontPolicies.createFixedPolicy(fontSet);
PlasticLookAndFeel.setFontPolicy(fixedPolicy);
UIManager
.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
} catch (Throwable t) {
try {
UIManager.setLookAndFeel(UIManager
.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
}
}