本文整理汇总了Java中javax.swing.plaf.nimbus.NimbusLookAndFeel类的典型用法代码示例。如果您正苦于以下问题:Java NimbusLookAndFeel类的具体用法?Java NimbusLookAndFeel怎么用?Java NimbusLookAndFeel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NimbusLookAndFeel类属于javax.swing.plaf.nimbus包,在下文中一共展示了NimbusLookAndFeel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAndShowGUI
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
private static void createAndShowGUI() {
try {
UIManager.setLookAndFeel(new TestLookAndFeel());
JLabel label = new JLabel("Test Label");
label.setSize(SIZE, SIZE);
TitledBorder border = new TitledBorder("ABCDEF");
label.setBorder(new TitledBorder(border));
if (useLAF) {
UIManager.setLookAndFeel(new NimbusLookAndFeel());
} else {
UIManager.getDefaults().put("LabelUI", MetalLabelUI.class.getName());
}
SwingUtilities.updateComponentTreeUI(label);
paintToImage(label);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
示例2: setupUILAF
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
private static void setupUILAF() {
try {
@SuppressWarnings("serial")
LookAndFeel laf = new NimbusLookAndFeel() {
@Override
public UIDefaults getDefaults() {
UIDefaults ret = super.getDefaults();
ret.put("defaultFont", Util.normalFont);
return ret;
}
};
UIManager.setLookAndFeel(laf);
} catch (Exception e) {
e.printStackTrace();
}
}
示例3: init
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
private void init(){
try {
javax.swing.UIManager.setLookAndFeel(new NimbusLookAndFeel());
javax.swing.SwingUtilities.updateComponentTreeUI(this);
} catch (UnsupportedLookAndFeelException exc) {
System.out.println("Nimbus LookAndFeel not loaded : "+exc);
}
cbMode.setModel(comboModelMode);
for(ModeType mode : ModeType.values()){
comboModelMode.addElement(mode);
}
cbMode.setSelectedIndex(0); // Force le rendu de lblSummary
cbTreatment.setModel(comboModelTreatment);
for(TreatmentType tr : TreatmentType.values()){
comboModelTreatment.addElement(tr);
}
cbTreatment.setSelectedIndex(0); // Force le rendu de lblSummary
}
示例4: main
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(new NimbusLookAndFeel());
Robot robot = new Robot();
robot.setAutoDelay(50);
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
createAndShowGUI();
}
});
toolkit.realSync();
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel");
point = previewPanel.getLocationOnScreen();
}
});
point.translate(5, 5);
robot.mouseMove(point.x, point.y);
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
}
示例5: main
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(new NimbusLookAndFeel());
Test6919629 t = new Test6919629();
t.test();
System.gc();
t.check();
}
示例6: main
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
nimbus = new NimbusLookAndFeel();
try {
UIManager.setLookAndFeel(nimbus);
} catch (UnsupportedLookAndFeelException e) {
throw new Error("Unable to set Nimbus LAF");
}
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
new ColorCustomizationTest().test();
}
});
}
示例7: main
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(new NimbusLookAndFeel());
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
new JLabel();
UIDefaults uid = UIManager.getDefaults();
uid.putDefaults(new Object[0]);
uid.put("what.ever", "else");
}
});
}
示例8: main
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(new NimbusLookAndFeel());
Robot robot = new Robot();
robot.setAutoDelay(50);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
createAndShowGUI();
}
});
robot.waitForIdle();
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel");
point = previewPanel.getLocationOnScreen();
}
});
point.translate(5, 5);
robot.mouseMove(point.x, point.y);
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
}
示例9: main
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
public static void main(String... args) throws Exception {
UIManager.setLookAndFeel(new NimbusLookAndFeel());
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
new bug6937798();
}
});
}
示例10: tryNimbusLookAndFeel
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
private static boolean tryNimbusLookAndFeel()
throws Exception {
try {
UIManager.setLookAndFeel(new NimbusLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
errorString += e.getMessage();
return false;
}
return true;
}
示例11: initTheme
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
/**
* 初始化look and feel
*/
public static void initTheme() {
try {
switch (configer.getTheme()) {
case "BeautyEye":
BeautyEyeLNFHelper.launchBeautyEyeLNF();
UIManager.put("RootPane.setupButtonVisible", false);
break;
case "weblaf":
UIManager.setLookAndFeel(new WebLookAndFeel());
break;
case "系统默认":
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
break;
case "Windows":
UIManager.setLookAndFeel(WindowsLookAndFeel.class.getName());
break;
case "Nimbus":
UIManager.setLookAndFeel(NimbusLookAndFeel.class.getName());
break;
case "Metal":
UIManager.setLookAndFeel(MetalLookAndFeel.class.getName());
break;
case "Motif":
UIManager.setLookAndFeel(MotifLookAndFeel.class.getName());
break;
case "Darcula(推荐)":
default:
UIManager.setLookAndFeel("com.bulenkov.darcula.DarculaLaf");
}
} catch (Exception e) {
logger.error(e);
}
}
示例12: main
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(new NimbusLookAndFeel());
} catch (UnsupportedLookAndFeelException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
MainWindow mainWindow = new MainWindow();
mainWindow.setResizable(false);
mainWindow.setLocationRelativeTo(null);
mainWindow.setVisible(true);
}
示例13: main
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
public static void main(String[] args) {
//Startup message
System.out.println("Now Starting Level Editor 2.0");
try { UIManager.setLookAndFeel(new NimbusLookAndFeel());} catch (UnsupportedLookAndFeelException e) {}
//Open project folder
File projectDir = Util.getDir(new File(new File("."), DIR_NAME));
//Open the project
new Project(projectDir).edit();
}
示例14: main
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
public static void main(String args[]) {
try {
UIManager.setLookAndFeel(new NimbusLookAndFeel());
} catch (Exception ex) {
}
new StreamPreview().setVisible(true);
}
示例15: updateGUI
import javax.swing.plaf.nimbus.NimbusLookAndFeel; //导入依赖的package包/类
public void updateGUI() {
updateNimbus();
for (Component component : mFrame.getComponents()) {
component.repaint();
}
for (Window window : Window.getWindows()) {
// SwingUtilities.updateComponentTreeUI(window);
NimbusLookAndFeel.updateStyles(window);
}
updateColorButtons();
}