當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。