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


Java LookAndFeelInfo.getName方法代码示例

本文整理汇总了Java中javax.swing.UIManager.LookAndFeelInfo.getName方法的典型用法代码示例。如果您正苦于以下问题:Java LookAndFeelInfo.getName方法的具体用法?Java LookAndFeelInfo.getName怎么用?Java LookAndFeelInfo.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.UIManager.LookAndFeelInfo的用法示例。


在下文中一共展示了LookAndFeelInfo.getName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
public static void main(final String[] args) throws Exception {
    try {
        createGUI();
        for (final LookAndFeelInfo laf : getInstalledLookAndFeels()) {
            final String name = laf.getName();
            if (name.contains("OS X") || name.contains("Metal")) {
                SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
                SwingUtilities.invokeAndWait(() -> {
                    for (int i = 0; i < 4000; ++i) {
                        SwingUtilities.updateComponentTreeUI(frame);
                    }
                });
            }
        }
    } finally {
        if (frame != null) { EventQueue.invokeAndWait(() -> frame.dispose()); }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:UnninstallUIMemoryLeaks.java

示例2: main

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
public static void main(final String[] args) throws Exception {
    try {
        createGUI();
        for (final LookAndFeelInfo laf : getInstalledLookAndFeels()) {
            final String name = laf.getName();
            if (name.contains("OS X") || name.contains("Metal")) {
                SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
                SwingUtilities.invokeAndWait(() -> {
                    for (int i = 0; i < 4000; ++i) {
                        SwingUtilities.updateComponentTreeUI(frame);
                    }
                });
            }
        }
    } finally {
        EventQueue.invokeAndWait(() -> frame.dispose());
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:19,代码来源:UnninstallUIMemoryLeaks.java

示例3: updateLookAndFeels

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
protected void updateLookAndFeels()
   {
clearButtons();
LookAndFeel currentLookAndFeel = UIManager.getLookAndFeel();
String current = currentLookAndFeel == null ? "" : currentLookAndFeel.getName();
LookAndFeelInfo[] infoArray = UIManager.getInstalledLookAndFeels();
if (infoArray == null || infoArray.length == 0) {
    return;
}

for (LookAndFeelInfo info : infoArray) {
    JRadioButtonMenuItem button = new JRadioButtonMenuItem(info.getName());
    button.setActionCommand(info.getClassName());
    if (info.getName().equals(current))
	button.setSelected(true);
    addButton(button);
}
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:19,代码来源:LookAndFeelMenuItem.java

示例4: createThemeMenu

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
private JMenu createThemeMenu() {
JMenu menu = new JMenu("Theme");
ButtonGroup group = new ButtonGroup();
for (final LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
    Action setLnF = new AbstractAction(info.getName()) {

	@Override
	public void actionPerformed(ActionEvent event) {
	    try {
		UIManager.setLookAndFeel(info.getClassName());
		SwingUtilities.updateComponentTreeUI(getRootPane());
	    } catch (Exception e) {
		setStatus("red", "Failed to load {} LaF.", info.getName());
	    }
	}
    };
    AbstractButton button = new JCheckBoxMenuItem(setLnF);
    group.add(button);
    menu.add(button);
}
return menu;
   }
 
开发者ID:Chatanga,项目名称:Girinoscope,代码行数:23,代码来源:UI.java

示例5: createLAFButtons

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
private static void createLAFButtons(final int lafIndex, final JFrame f, final JPanel radioPanel) {
  final ButtonGroup bGroup = new ButtonGroup();
  for (int i = 0; i < lafs.length; i++) {
    final int index = i;
    final LookAndFeelInfo laf = lafs[index];
    String title = laf.getName();
    if (index == systemLafIndex) {
      title += " (system L&F)";
    }
    final JRadioButton lafButton = new JRadioButton(title);
    if (index == lafIndex) {
      lafButton.setSelected(true);
    }
    lafButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(final ActionEvent e) {
        updateLAF(index, f);
      }
    });
    radioPanel.add(lafButton);
    bGroup.add(lafButton);
  }
}
 
开发者ID:UprootLabs,项目名称:swing-htabs,代码行数:24,代码来源:HTabsDemoApp.java

示例6: createLookAndFeelMenuItems

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
/**
 * Adds menu items to the given menu for each look and feel
 * installed in the running vm.
 *
 * @param menu the menu to add the items to
 */
private void createLookAndFeelMenuItems(JMenu menu) {
    LookAndFeel current = UIManager.getLookAndFeel();
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        JMenuItem mnuLaF = new JMenuItem(info.getName());
        if (current.getClass().getName().equals(info.getClassName())) {
            mnuLaF.setIcon(Icons.CHECK);
        }
        mnuLaF.setActionCommand("laf+" + info.getClassName());
        mnuLaF.addActionListener(this);
        menu.add(mnuLaF);
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:19,代码来源:Sandbox.java

示例7: fillLAndFeelMenu

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
private void fillLAndFeelMenu() {
  final LookAndFeelInfo plaf[] = UIManager.getInstalledLookAndFeels();
  this.lookAndFeelMap = new HashMap<String, LookAndFeelInfo>();
  final ButtonGroup lfGroup = new ButtonGroup();

  final ActionListener lfListener = new ActionListener() {

    @Override
    public void actionPerformed(final ActionEvent e) {
      final JRadioButtonMenuItem item = (JRadioButtonMenuItem) e.getSource();
      setSelectedLookAndFeel(item.getText());
    }
  };

  for (LookAndFeelInfo aPlaf : plaf) {
    final String lfName = aPlaf.getName();

    if (lfName.toLowerCase(Locale.ENGLISH).contains("nimbus")) {
      continue;
    }

    lookAndFeelMap.put(lfName, aPlaf);
    JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(lfName);

    menuItem.addActionListener(lfListener);

    lfGroup.add(menuItem);
    menuLookAndFeel.add(menuItem);
  }
}
 
开发者ID:raydac,项目名称:jprol,代码行数:31,代码来源:MainFrame.java

示例8: createLookAndFeelMenuItems

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
/**
 * Adds menu items to the given menu for each look and feel
 * installed in the running vm.
 * @param menu the menu to add the items to
 */
private void createLookAndFeelMenuItems(JMenu menu) {
	LookAndFeel current = UIManager.getLookAndFeel();
	for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
		JMenuItem mnuLaF = new JMenuItem(info.getName());
		if (current.getClass().getName().equals(info.getClassName())) {
			mnuLaF.setIcon(Icons.SELECTED);
		}
		mnuLaF.setActionCommand("laf+" + info.getClassName());
		mnuLaF.addActionListener(this);
		menu.add(mnuLaF);
	}
}
 
开发者ID:wnbittle,项目名称:praisenter,代码行数:18,代码来源:Praisenter.java

示例9: ChangeLookAndFeelAction

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
ChangeLookAndFeelAction(CliGuiContext cliGuiCtx, LookAndFeelInfo lookAndFeelInfo) {
    super(lookAndFeelInfo.getName());
    this.cliGuiCtx = cliGuiCtx;
    this.lookAndFeelInfo = lookAndFeelInfo;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:6,代码来源:GuiMain.java


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