List of usage examples for javax.swing UnsupportedLookAndFeelException getMessage
public String getMessage()
From source file:edu.harvard.mcz.imagecapture.ImageCaptureApp.java
/**Main method for starting the application. * /* w w w . j a va 2 s . c o m*/ * @param args are not used. */ public static void main(String[] args) { log.debug(UIManager.getLookAndFeel()); log.debug(UIManager.getLookAndFeel().getID()); if (UIManager.getLookAndFeel().getID().equals("Aqua")) { // check for "Aqua" try { UIManager.setLookAndFeel( // OSX Aqua look and feel uses space on forms much too inefficiently // switch to the normal Java look and feel instead. UIManager.getCrossPlatformLookAndFeelClassName()); } catch (UnsupportedLookAndFeelException e) { log.error(e); } catch (ClassNotFoundException e) { log.error(e); } catch (InstantiationException e) { log.error(e); } catch (IllegalAccessException e) { log.error(e); } } System.out.println("Starting " + APP_NAME + " " + APP_VERSION); System.out.println(APP_COPYRIGHT); System.out.println(APP_LICENSE); log.debug("Starting " + APP_NAME + " " + APP_VERSION); // open UI and start MainFrame mainFrame = new MainFrame(); Singleton.getSingletonInstance().setMainFrame(mainFrame); Singleton.getSingletonInstance().getMainFrame().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); Singleton.getSingletonInstance().unsetCurrentUser(); Singleton.getSingletonInstance().getMainFrame().setStatusMessage("Starting...."); log.debug("User interface started"); // Load properties ImageCaptureProperties properties = new ImageCaptureProperties(); Singleton.getSingletonInstance().setProperties(properties); log.debug("Properties loaded"); // Set up a barcode (text read from barcode label for pin) matcher/builder if (Singleton.getSingletonInstance().getProperties().getProperties() .getProperty(ImageCaptureProperties.KEY_COLLECTION) .equals(ImageCaptureProperties.COLLECTION_MCZENT)) { // ** Configured for the MCZ Entomology Collection, use MCZ assumptions. MCZENTBarcode barcodeTextBuilderMatcher = new MCZENTBarcode(); Singleton.getSingletonInstance().setBarcodeBuilder((BarcodeBuilder) barcodeTextBuilderMatcher); Singleton.getSingletonInstance().setBarcodeMatcher((BarcodeMatcher) barcodeTextBuilderMatcher); } else if (Singleton.getSingletonInstance().getProperties().getProperties() .getProperty(ImageCaptureProperties.KEY_COLLECTION) .equals(ImageCaptureProperties.COLLECTION_ETHZENT)) { // ** Configured for the ETHZ Entomology Collection, use MCZ assumptions. ETHZBarcode barcodeTextBuilderMatcher = new ETHZBarcode(); Singleton.getSingletonInstance().setBarcodeBuilder((BarcodeBuilder) barcodeTextBuilderMatcher); Singleton.getSingletonInstance().setBarcodeMatcher((BarcodeMatcher) barcodeTextBuilderMatcher); } else { log.error("Configured collection not recognized. Unable to Start"); ImageCaptureApp.exit(EXIT_ERROR); } // Force a login dialog by connecting to obtain record count; SpecimenLifeCycle sls = new SpecimenLifeCycle(); try { Singleton.getSingletonInstance().getMainFrame().setCount(sls.findSpecimenCountThrows()); ImageCaptureApp.doStartUp(); } catch (ConnectionException e) { log.error(e.getMessage()); ImageCaptureApp.doStartUpNot(); } // Experimental chat support, working on localhost. /** Context context = null; Hashtable contextProperties = new Hashtable(2); contextProperties.put(Context.PROVIDER_URL,"iiop://127.0.0.1:3700"); contextProperties.put("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory"); contextProperties.put("java.naming.factory.url.pkgs", "com.sun.enterprise.naming"); contextProperties.put("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl"); try { context = new InitialContext(contextProperties); } catch (NamingException ex) { ex.printStackTrace(); } if (context!=null) { ConnectionFactory connectionFactory; try { connectionFactory = (ConnectionFactory)context.lookup("jms/InsectChatTopicFactory"); Topic chatTopic = (Topic)context.lookup("jms/InsectChatTopic"); TopicConnection connection = (TopicConnection) connectionFactory.createConnection(); TopicSession session = connection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE); TopicSubscriber subscriber = session.createSubscriber(chatTopic); connection.start(); while (true) { Message m = subscriber.receive(1); if (m != null) { if (m instanceof TextMessage) { TextMessage message = (TextMessage) m; String originator = message.getStringProperty("Originator"); String text = message.getText(); System.out.println("Message: " + originator + ": " + text); } else { break; } } } } catch (NamingException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (JMSException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } */ }
From source file:de.unidue.inf.is.ezdl.gframedl.EzDL.java
private static void initDesktopSystem() { RepaintManager.setCurrentManager(new CheckThreadViolationRepaintManager()); Dispatcher.logEventDispatch = false; Dispatcher.logIncomingEvents = false; Dispatcher.logRegistration = false;// w ww. j a v a 2s . c om Dispatcher.logWithThreadInfo = false; JFrame.setDefaultLookAndFeelDecorated(false); JDialog.setDefaultLookAndFeelDecorated(false); I18nSupport.getInstance().init(Config.getInstance().getUserProperty("desktop.language", "en")); try { if (SystemUtils.OS == OperatingSystem.MAC_OS) { System.setProperty("apple.laf.useScreenMenuBar", "true"); } else { checkJavaVersion(); for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } } } catch (UnsupportedLookAndFeelException e) { logger.error(e.getMessage(), e); } catch (ClassNotFoundException e) { logger.error(e.getMessage(), e); } catch (InstantiationException e) { logger.error(e.getMessage(), e); } catch (IllegalAccessException e) { logger.error(e.getMessage(), e); } }
From source file:ro.nextreports.designer.NextReports.java
private void setLookAndFeel() { try {/* ww w . j ava 2s . c o m*/ PlasticLookAndFeel.setCurrentTheme(new ExperienceBlue()); UIManager.setLookAndFeel(new PlasticXPLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); LOG.error(e.getMessage(), e); } }