当前位置: 首页>>代码示例>>Java>>正文


Java NimbusLookAndFeel类代码示例

本文整理汇总了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);
        }
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:TitledBorderLabelUITest.java

示例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();
	}
}
 
开发者ID:krakrjak,项目名称:AkarshMan,代码行数:17,代码来源:Application.java

示例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
}
 
开发者ID:TW2,项目名称:Feuille,代码行数:21,代码来源:XKCStep3.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:30,代码来源:Test6827032.java

示例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();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:8,代码来源:Test6919629.java

示例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();
        }
    });
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:ColorCustomizationTest.java

示例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");
        }
    });
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:Test7048204.java

示例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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:Test6827032.java

示例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();
        }
    });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:bug6937798.java

示例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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:bug8057791.java

示例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);
    }

}
 
开发者ID:rememberber,项目名称:WePush,代码行数:39,代码来源:Init.java

示例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);
}
 
开发者ID:MarkXLII,项目名称:subtitle-studio,代码行数:13,代码来源:Main.java

示例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();
}
 
开发者ID:RedInquisitive,项目名称:Haxa-Editor,代码行数:13,代码来源:Editor.java

示例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);
}
 
开发者ID:s4kibs4mi,项目名称:ISeeUReceiver,代码行数:10,代码来源:StreamPreview.java

示例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();
}
 
开发者ID:Dakkra,项目名称:PyxleOS,代码行数:14,代码来源:MainWindow.java


注:本文中的javax.swing.plaf.nimbus.NimbusLookAndFeel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。