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


Java UnsupportedLookAndFeelException类代码示例

本文整理汇总了Java中javax.swing.UnsupportedLookAndFeelException的典型用法代码示例。如果您正苦于以下问题:Java UnsupportedLookAndFeelException类的具体用法?Java UnsupportedLookAndFeelException怎么用?Java UnsupportedLookAndFeelException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: BaseUtility

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
@SuppressWarnings("nls")
protected BaseUtility()
{
	try
	{
		UIManager.setLookAndFeel(new FlatterLookAndFeel());
		System.setProperty("org.apache.commons.logging.LogFactory",
			"org.apache.commons.logging.impl.SLF4JLogFactory");
		BlindSSLSocketFactory.register();
		AxisProperties.setProperty("axis.socketSecureFactory",
			"org.apache.axis.components.net.SunFakeTrustSocketFactory");
	}
	catch( UnsupportedLookAndFeelException e )
	{
		throw new RuntimeException(e);
	}
	data = new SharedData();
	createGUI();
}
 
开发者ID:equella,项目名称:Equella,代码行数:20,代码来源:BaseUtility.java

示例2: main

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
public static void main(String[] args) {
    UIManager.put("swing.boldMetal", Boolean.FALSE);
    JDialog.setDefaultLookAndFeelDecorated(true);
    JFrame.setDefaultLookAndFeelDecorated(true);
    Toolkit.getDefaultToolkit().setDynamicLayout(true);
    System.setProperty("sun.awt.noerasebackground", "true");
    try {
        UIManager.setLookAndFeel(new MetalLookAndFeel());
    } catch (UnsupportedLookAndFeelException e) {
        System.out.println(
                "Metal Look & Feel not supported on this platform. \n"
                + "Program Terminated");
        System.exit(0);
    }
    JFrame frame = new MetalworksFrame();
    frame.setVisible(true);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:Metalworks.java

示例3: init

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
public void init() {
    JFrame.setDefaultLookAndFeelDecorated(true);

    try {
        UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    } catch (ClassNotFoundException | InstantiationException |
            IllegalAccessException | UnsupportedLookAndFeelException ex) {
        throw new RuntimeException("Test Failed. MetalLookAndFeel not set "
                + "for frame");
    }

    frame = new JFrame("JFrame Maximization Test");
    frame.pack();
    frame.setSize(450, 260);
    frame.setVisible(true);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:MaximizedFrameTest.java

示例4: initialize

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
/**
 * Initialisationsmethode, die in jedem Konstruktor benutzt wird
 * @param layout
 * @param panels
 */
void initialize(LayoutManager layout, ArrayList<JPanel> panels){
	this.setLayout(layout);
	for(JPanel panel: panels){
		this.add(panel);
	}
	this.setTitle("Random Music Generator Canon");
	this.setSize(1200, 700);
	//places Frame in the middle of the screen
	this.setLocationRelativeTo(null);
	this.setResizable(true);
	this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
	this.addWindowListener(new defaultWindowListener());
	//adjusting look to local system 
	try {
		UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
	} catch (ClassNotFoundException | InstantiationException
			| IllegalAccessException | UnsupportedLookAndFeelException e) {
		e.printStackTrace();
	}
	//shows the Frame on the screen
	this.setVisible(true);
}
 
开发者ID:Paulpanther,项目名称:Random-Music-Generator,代码行数:28,代码来源:Window.java

示例5: testSinglePlatformInstall

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
public void testSinglePlatformInstall () throws IOException, UnsupportedLookAndFeelException {
    UIManager.setLookAndFeel(new MetalLookAndFeel());
    InstallerRegistry regs = InstallerRegistryAccessor.prepareForUnitTest(new GeneralPlatformInstall[] {
        new FileBasedPlatformInstall ("FileBased1", Collections.<WizardDescriptor.Panel<WizardDescriptor>>singletonList(
            new Panel ("FileBased1_panel1")
        ))
    });
    PlatformInstallIterator iterator = PlatformInstallIterator.create();
    WizardDescriptor wd = new WizardDescriptor (iterator);
    iterator.initialize(wd);
    assertEquals("Invalid state", 1, iterator.getPanelIndex());
    WizardDescriptor.Panel panel = iterator.current();
    assertTrue ("Invalid panel",panel instanceof LocationChooser.Panel);
    ((JFileChooser)panel.getComponent()).setSelectedFile(this.getWorkDir());    //Select some folder
    assertTrue ("LocationChooser is not valid after folder was selected",panel.isValid());
    assertTrue ("Should have next panel",iterator.hasNext());
    assertFalse ("Should not have previous panel", iterator.hasPrevious());
    iterator.nextPanel();
    assertEquals("Invalid state", 2, iterator.getPanelIndex());
    panel = iterator.current();
    assertEquals("Invalid panel","FileBased1_panel1",panel.getComponent().getName());
    assertFalse ("Should not have next panel",iterator.hasNext());
    assertTrue ("Should have previous panel", iterator.hasPrevious());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:PlatformInstallIteratorTest.java

示例6: main

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
public static void main(String[] args) {
    if (args.length > 0) {
        debug = args[0] == "-d";
    }
    
    try {
        javax.swing.UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    }
    catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
        System.err.print(ex);
    }
    
    Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler());
    
    new Main().setVisible(true);
}
 
开发者ID:SunakazeKun,项目名称:PMDe,代码行数:17,代码来源:Main.java

示例7: main

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
/**
 * Main
 */
public static void main(String[] args) throws Exception {
    try {
        //UIManager.setLookAndFeel("com.jtattoo.plaf.hifi.HiFiLookAndFeel");
        // Nero, troppo nero. (L'unico con i jcombobox neri) - brutto rendering dadi/coni dadi
        //UIManager.setLookAndFeel("com.jtattoo.plaf.noire.NoireLookAndFeel"); 
        // (Nero, troppo nero. (L'unico con i jcombobox neri))^2.Un po' più di arancione in giro, scritte più bianche
        UIManager.setLookAndFeel("com.jtattoo.plaf.aluminium.AluminiumLookAndFeel");
        // Grigio scuro, bottoni bocciatissimi. (forse il mio preferito? Forse serve qualcosa che faccia contrasto? boh)
    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
        Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
    }

    StartGameGUI start = new StartGameGUI();
    start.setVisible(true);
}
 
开发者ID:IngSW-unipv,项目名称:Progetto-B,代码行数:19,代码来源:Risiko.java

示例8: complain

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
static void complain(String message) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException, IOException, URISyntaxException, InterruptedException
{
	// Resort to a Swing Y/N dialog asking if the user wants to update Java.
	// If they click yes, their default browser will open to the JAVA_UPDATE_URL
	UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
	int reply = JOptionPane.showConfirmDialog(null, message, "NoMoreOversleeps", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE);
	if (reply == 0)
	{
		String platformCode = "";
		if (PlatformData.platformType == PlatformType.WINDOWS)
		{
			platformCode = PlatformData.is64bitOS ? "?platform=win64" : "?platform=win32";
		}
		else if (PlatformData.platformType == PlatformType.MAC)
		{
			platformCode = "?platform=mac";
		}
		else
		{
			platformCode = "?platform=linux";
		}
		java.awt.Desktop.getDesktop().browse(new URI(Main.JAVA_UPDATE_URL + platformCode));
		Thread.sleep(100);
	}
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:26,代码来源:Main.java

示例9: main

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
/**
 * @param args the command line arguments
 */
public static void main(String args[]) {
    /* Set the Nimbus look and feel */
    //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
    /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
     * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
     */
    try {
        for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
        Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    }
    //</editor-fold>

    //</editor-fold>

    /* Create and display the form */
    java.awt.EventQueue.invokeLater(() -> {
        new Main().setVisible(true);
    });
}
 
开发者ID:EvilInsultGenerator,项目名称:desktop,代码行数:29,代码来源:Main.java

示例10: main

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
public static void main(String args[]) {
    //Look and Feel del sistema operativo
    try {
        // Set Look and Feel to "System" which means that Swing will use the
        // OS's native GUI toolkit to render the application, making it look
        // native
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    }
    catch(ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
        System.out.println("Errore GUI: " + ex);
        JOptionPane.showMessageDialog(null, "Errore GUI: " + ex);
    }

    /* Create and display the form */
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            new CharRecognizer().setVisible(true);
        }
    });
}
 
开发者ID:AhabHyde,项目名称:NeuralNet,代码行数:21,代码来源:CharRecognizer.java

示例11: Gui

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
public Gui() throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
	UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
	frame = new JFrame("ElectroLight Penetration Testing");
	menuBar = new JMenuBar();
	frame.setJMenuBar(menuBar);
	
	JMenu mnCounterhack = new JMenu("Counter-hack");
	menuBar.add(mnCounterhack);
	
	JMenuItem mntmArpScan = new JMenuItem("ARP Scan");
	mnCounterhack.add(mntmArpScan);
	frame.setSize(300, 200);
	
	JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
	frame.getContentPane().add(tabbedPane, BorderLayout.CENTER);
	
	// Always keep the 2 following lines at the end.
	//frame.pack();
	frame.setVisible(true);
}
 
开发者ID:Electro-Light,项目名称:ElectroLight-Penetration-Testing,代码行数:21,代码来源:Gui.java

示例12: LoginGUI

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
/** Creates new form WalletLoginGUI */
public LoginGUI() {
	/* Set Nimbus look and feel. */
	try {
		for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
			if ("Nimbus".equals(info.getName())) {
				UIManager.setLookAndFeel(info.getClassName());
				break;
			}
		}
	} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
		System.err.println(e.getMessage());
	}
	initComponents();
	Utils.setWindowCenterOfScreen(this);
	setVisible(true);
}
 
开发者ID:FrankieF,项目名称:FJSTSeniorProjectSpring2017,代码行数:18,代码来源:LoginGUI.java

示例13: RegisterGUI

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
/** Creates new form RegisterGUI */
public RegisterGUI() {
	/* Set Nimbus look and feel. */
	try {
		for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
			if ("Nimbus".equals(info.getName())) {
				UIManager.setLookAndFeel(info.getClassName());
				break;
			}
		}
	} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException exception) {
		java.util.logging.Logger.getLogger(LoginGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, exception);
	}
	initComponents();
	Utils.setWindowCenterOfScreen(this);
	setVisible(true);
}
 
开发者ID:FrankieF,项目名称:FJSTSeniorProjectSpring2017,代码行数:18,代码来源:RegisterGUI.java

示例14: getGraph

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
public JFrame getGraph() {
  try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
      | UnsupportedLookAndFeelException e1) {
    e1.printStackTrace();
  }

  final AlloyInstance instance = StaticInstanceMaker.createInstance(this.universe);
  final VizState myState = new VizState(instance);
  final JFrame frame = new JFrame("Visualization");
  final VizGraphPanel graph = new VizGraphPanel(myState, false);

  frame.add(graph);
  graph.alloyGetViewer().alloyRepaint();

  return frame;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:19,代码来源:Visualization.java

示例15: setTheme

import javax.swing.UnsupportedLookAndFeelException; //导入依赖的package包/类
private void setTheme() {
  try {
    /*
     * TODO BUG
     * 
     * A Fatal Error occurs while setting GTK look and feel on Ubuntu 16.04
     * (com.sun.java.swing.plaf.gtk.GTKLookAndFeel).
     * 
     */
    final String LaF = UIManager.getSystemLookAndFeelClassName();
    if ("com.sun.java.swing.plaf.gtk.GTKLookAndFeel".equals(LaF)) {
      UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
    } else {
      UIManager.setLookAndFeel(LaF);
    }
  } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
      | UnsupportedLookAndFeelException e1) {
    e1.printStackTrace();
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:21,代码来源:BoundSelectionPage.java


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