Example usage for javax.swing UIManager setLookAndFeel

List of usage examples for javax.swing UIManager setLookAndFeel

Introduction

In this page you can find the example usage for javax.swing UIManager setLookAndFeel.

Prototype

@SuppressWarnings("deprecation")
public static void setLookAndFeel(String className) throws ClassNotFoundException, InstantiationException,
        IllegalAccessException, UnsupportedLookAndFeelException 

Source Link

Document

Loads the LookAndFeel specified by the given class name, using the current thread's context class loader, and passes it to setLookAndFeel(LookAndFeel) .

Usage

From source file:org.jdal.swing.ApplicationContextGuiFactory.java

public static void setPlasticLookAndFeel() {
    try {/* w  w w  .  j a v  a  2  s.  co m*/
        UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
        UIManager.put("Table.gridColor", new ColorUIResource(Color.GRAY));
        UIManager.put("TableHeader.background", new ColorUIResource(220, 220, 220));

    } catch (UnsupportedLookAndFeelException e) {
        log.error(e);
    }
}

From source file:com.josescalia.tumblr.app.MainFrame.java

/**
 * @param args the command line arguments
 *///from   ww  w .  ja  v a 2s.  co m
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 ex) {
        java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    } catch (InstantiationException ex) {
        java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    } catch (IllegalAccessException ex) {
        java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    } catch (UnsupportedLookAndFeelException ex) {
        java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    }
    //</editor-fold>

    /* Create and display the form */
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            new MainFrame().setVisible(true);
        }
    });
}

From source file:de.uzk.hki.da.main.SIPBuilder.java

/**
 * Starts the SIP-Builder in GUI mode// ww  w.j av a  2 s .c  o  m
 * 
 * @param confFolderPath Path to conf folder
 * @param dataFolderPath Path to data folder
 */
private static void startGUIMode(String confFolderPath, String dataFolderPath) {

    try {
        UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
    } catch (Exception e) {
        return;
    }

    UIManager.put("Label.disabledForeground", Color.LIGHT_GRAY);
    UIManager.put("ComboBox.disabledForeground", Color.LIGHT_GRAY);
    UIManager.put("CheckBox.disabledText", Color.LIGHT_GRAY);

    Gui gui = new Gui(confFolderPath, dataFolderPath);
    gui.setBounds(100, 100, 750, 520);
    gui.setResizable(false);
    gui.setVisible(true);
    gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    gui.setTitle(getProperties().getProperty("ARCHIVE_NAME") + " SIP-Builder");
}

From source file:com.mirth.connect.manager.ManagerDialog.java

public ManagerDialog() {
    try {/*w w  w. j  a v a  2  s. c  o m*/
        PlasticLookAndFeel.setPlasticTheme(new MirthTheme());
        PlasticXPLookAndFeel look = new PlasticXPLookAndFeel();
        UIManager.setLookAndFeel(look);
        UIManager.put("win.xpstyle.name", "metallic");

        LookAndFeelAddons.setAddon(WindowsLookAndFeelAddons.class);

        getContentPane().setBackground(Color.WHITE);
        setTitle("Mirth Connect Server Manager");
        setResizable(false);

        serviceController = ServiceControllerFactory.getServiceController();
        managerController = ManagerController.getInstance();
        heapSize = (String) managerController.getServerProperties()
                .getProperty(ManagerConstants.ADMINISTRATOR_MAX_HEAP_SIZE);
    } catch (Exception e) {
        e.printStackTrace();
        System.exit(1);
    }
}

From source file:com.univocity.app.swing.DataAnalysisWindow.java

private void setLookAndFeel() {
    System.setProperty("awt.useSystemAAFontSettings", "on");
    System.setProperty("swing.aatext", "true");
    WindowUtils.fixDisplayOnLinux(this);

    try {//from  ww w.  java 2s . c o  m
        for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (Exception e) {
        //keep the default
    }
}

From source file:LicenseGenerator.java

/**
 * Initialize the contents of the frame.
 *//*from   w w w  .j  a v a  2s .c o  m*/
private void initialize() {
    try {
        UIManager.setLookAndFeel(new WindowsLookAndFeel());
    } catch (UnsupportedLookAndFeelException ex) {
    }

    m_frame = new JFrame();
    m_frame.setTitle("License?");
    m_frame.setResizable(false);
    m_frame.setBounds(100, 100, 496, 483);
    m_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    m_frame.getContentPane().setLayout(null);

    chkDate = new JCheckBox("?");
    chkDate.setSelected(true);
    chkDate.setBounds(6, 6, 103, 23);
    m_frame.getContentPane().add(chkDate);

    txtDate = new JTextField();
    txtDate.setText("20131231");
    txtDate.setHorizontalAlignment(SwingConstants.RIGHT);
    txtDate.setBounds(131, 7, 193, 21);
    m_frame.getContentPane().add(txtDate);
    txtDate.setColumns(10);

    chkAdapterNum = new JCheckBox("???");
    chkAdapterNum.setSelected(true);
    chkAdapterNum.setBounds(6, 37, 119, 23);
    m_frame.getContentPane().add(chkAdapterNum);

    txtAdapterNum = new JTextField();
    txtAdapterNum.setText("000012");
    txtAdapterNum.setHorizontalAlignment(SwingConstants.RIGHT);
    txtAdapterNum.setColumns(10);
    txtAdapterNum.setBounds(131, 38, 193, 21);
    m_frame.getContentPane().add(txtAdapterNum);

    chkAdapter = new JCheckBox(
            "??? (?? ???)");
    chkAdapter.setSelected(true);
    chkAdapter.setBounds(6, 76, 465, 23);
    m_frame.getContentPane().add(chkAdapter);

    chkHTTP_C = new JCheckBox("http.c");
    chkHTTP_C.setSelected(true);
    chkHTTP_C.setBounds(43, 130, 76, 23);
    m_frame.getContentPane().add(chkHTTP_C);

    txtHTTP_C = new JTextField();
    txtHTTP_C.setText("20131231");
    txtHTTP_C.setHorizontalAlignment(SwingConstants.RIGHT);
    txtHTTP_C.setBounds(131, 131, 103, 21);
    m_frame.getContentPane().add(txtHTTP_C);
    txtHTTP_C.setColumns(10);

    chkSOAP_C = new JCheckBox("soap.c");
    chkSOAP_C.setSelected(true);
    chkSOAP_C.setBounds(43, 161, 76, 23);
    m_frame.getContentPane().add(chkSOAP_C);

    txtSOAP_C = new JTextField();
    txtSOAP_C.setText("20131231");
    txtSOAP_C.setHorizontalAlignment(SwingConstants.RIGHT);
    txtSOAP_C.setColumns(10);
    txtSOAP_C.setBounds(131, 162, 103, 21);
    m_frame.getContentPane().add(txtSOAP_C);

    chkTCP_C = new JCheckBox("tcp.c");
    chkTCP_C.setSelected(true);
    chkTCP_C.setBounds(43, 192, 76, 23);
    m_frame.getContentPane().add(chkTCP_C);

    txtTCP_C = new JTextField();
    txtTCP_C.setText("20131231");
    txtTCP_C.setHorizontalAlignment(SwingConstants.RIGHT);
    txtTCP_C.setColumns(10);
    txtTCP_C.setBounds(131, 193, 103, 21);
    m_frame.getContentPane().add(txtTCP_C);

    chkUDP_C = new JCheckBox("udp.c");
    chkUDP_C.setSelected(true);
    chkUDP_C.setBounds(43, 223, 76, 23);
    m_frame.getContentPane().add(chkUDP_C);

    txtUDP_C = new JTextField();
    txtUDP_C.setText("20131231");
    txtUDP_C.setHorizontalAlignment(SwingConstants.RIGHT);
    txtUDP_C.setColumns(10);
    txtUDP_C.setBounds(131, 224, 103, 21);
    m_frame.getContentPane().add(txtUDP_C);

    chkTUXEDO_C = new JCheckBox("tuxedo.c");
    chkTUXEDO_C.setSelected(true);
    chkTUXEDO_C.setBounds(43, 254, 76, 23);
    m_frame.getContentPane().add(chkTUXEDO_C);

    txtTUXEDO_C = new JTextField();
    txtTUXEDO_C.setText("20131231");
    txtTUXEDO_C.setHorizontalAlignment(SwingConstants.RIGHT);
    txtTUXEDO_C.setColumns(10);
    txtTUXEDO_C.setBounds(131, 255, 103, 21);
    m_frame.getContentPane().add(txtTUXEDO_C);

    chkMQ_C = new JCheckBox("mq.c");
    chkMQ_C.setSelected(true);
    chkMQ_C.setBounds(43, 286, 76, 23);
    m_frame.getContentPane().add(chkMQ_C);

    txtMQ_C = new JTextField();
    txtMQ_C.setText("20131231");
    txtMQ_C.setHorizontalAlignment(SwingConstants.RIGHT);
    txtMQ_C.setColumns(10);
    txtMQ_C.setBounds(131, 287, 103, 21);
    m_frame.getContentPane().add(txtMQ_C);

    chkHTTP_S = new JCheckBox("http.s");
    chkHTTP_S.setSelected(true);
    chkHTTP_S.setBounds(283, 130, 76, 23);
    m_frame.getContentPane().add(chkHTTP_S);

    txtHTTP_S = new JTextField();
    txtHTTP_S.setText("20131231");
    txtHTTP_S.setHorizontalAlignment(SwingConstants.RIGHT);
    txtHTTP_S.setColumns(10);
    txtHTTP_S.setBounds(368, 130, 103, 21);
    m_frame.getContentPane().add(txtHTTP_S);

    chkSOAP_S = new JCheckBox("soap.s");
    chkSOAP_S.setSelected(true);
    chkSOAP_S.setBounds(283, 161, 76, 23);
    m_frame.getContentPane().add(chkSOAP_S);

    txtSOAP_S = new JTextField();
    txtSOAP_S.setText("20131231");
    txtSOAP_S.setHorizontalAlignment(SwingConstants.RIGHT);
    txtSOAP_S.setColumns(10);
    txtSOAP_S.setBounds(368, 161, 103, 21);
    m_frame.getContentPane().add(txtSOAP_S);

    chkTCP_S = new JCheckBox("tcp.s");
    chkTCP_S.setSelected(true);
    chkTCP_S.setBounds(283, 192, 76, 23);
    m_frame.getContentPane().add(chkTCP_S);

    txtTCP_S = new JTextField();
    txtTCP_S.setText("20131231");
    txtTCP_S.setHorizontalAlignment(SwingConstants.RIGHT);
    txtTCP_S.setColumns(10);
    txtTCP_S.setBounds(368, 192, 103, 21);
    m_frame.getContentPane().add(txtTCP_S);

    chkUDP_S = new JCheckBox("udp.s");
    chkUDP_S.setSelected(true);
    chkUDP_S.setBounds(283, 223, 76, 23);
    m_frame.getContentPane().add(chkUDP_S);

    txtUDP_S = new JTextField();
    txtUDP_S.setText("20131231");
    txtUDP_S.setHorizontalAlignment(SwingConstants.RIGHT);
    txtUDP_S.setColumns(10);
    txtUDP_S.setBounds(368, 223, 103, 21);
    m_frame.getContentPane().add(txtUDP_S);

    chkTUXEDO_S = new JCheckBox("tuxedo.s");
    chkTUXEDO_S.setSelected(true);
    chkTUXEDO_S.setBounds(283, 254, 76, 23);
    m_frame.getContentPane().add(chkTUXEDO_S);

    txtTUXEDO_S = new JTextField();
    txtTUXEDO_S.setText("20131231");
    txtTUXEDO_S.setHorizontalAlignment(SwingConstants.RIGHT);
    txtTUXEDO_S.setColumns(10);
    txtTUXEDO_S.setBounds(368, 254, 103, 21);
    m_frame.getContentPane().add(txtTUXEDO_S);

    chkMQ_S = new JCheckBox("mq.s");
    chkMQ_S.setSelected(true);
    chkMQ_S.setBounds(283, 286, 76, 23);
    m_frame.getContentPane().add(chkMQ_S);

    txtMQ_S = new JTextField();
    txtMQ_S.setText("20131231");
    txtMQ_S.setHorizontalAlignment(SwingConstants.RIGHT);
    txtMQ_S.setColumns(10);
    txtMQ_S.setBounds(368, 286, 103, 21);
    m_frame.getContentPane().add(txtMQ_S);

    JLabel lblAdapterType1 = new JLabel("???");
    lblAdapterType1.setBounds(43, 105, 115, 15);
    m_frame.getContentPane().add(lblAdapterType1);

    JLabel lblAdapterType2 = new JLabel("??");
    lblAdapterType2.setBounds(283, 105, 103, 15);
    m_frame.getContentPane().add(lblAdapterType2);

    JLabel lblAdapterDate1 = new JLabel("?");
    lblAdapterDate1.setHorizontalAlignment(SwingConstants.RIGHT);
    lblAdapterDate1.setBounds(168, 106, 66, 15);
    m_frame.getContentPane().add(lblAdapterDate1);

    JLabel lblAdapterDate2 = new JLabel("?");
    lblAdapterDate2.setHorizontalAlignment(SwingConstants.RIGHT);
    lblAdapterDate2.setBounds(405, 105, 66, 15);
    m_frame.getContentPane().add(lblAdapterDate2);

    JButton cmdLicense = new JButton("?license");
    cmdLicense.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            cmdLicense_click(e);
        }
    });
    cmdLicense.setBounds(302, 332, 169, 23);
    m_frame.getContentPane().add(cmdLicense);

    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setBounds(6, 367, 478, 82);
    m_frame.getContentPane().add(scrollPane);

    txtLicense = new JTextArea();
    txtLicense.setEditable(false);
    scrollPane.setViewportView(txtLicense);
}

From source file:com.nubits.nubot.launch.toolkit.LaunchUI.java

private String askUser() {
    //Create Options for option dialog
    String path = "";

    // Set cross-platform Java L&F (also called "Metal")
    try {//from  ww w . j  av a 2s  .  com
        UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());

        final ImageIcon icon = new ImageIcon(local_path + "/" + ICON_PATH);

        //Ask the user to ask for scratch
        Object[] options = { "Import existing JSON option file", "Configure the bot from scratch" };

        int n = JOptionPane.showOptionDialog(new JFrame(), "Chose one of the following options:",
                "NuBot UI Launcher", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, icon, //do not use a custom Icon
                options, //the titles of buttons
                options[0]); //default button title

        if (n == JOptionPane.YES_OPTION) {

            //Prompt user to chose a file.
            JFileChooser fileChooser = createFileChoser();

            int result = fileChooser.showOpenDialog(new JFrame());
            if (result == JFileChooser.APPROVE_OPTION) {
                File selectedFile = fileChooser.getSelectedFile();
                path = selectedFile.getAbsolutePath();
                LOG.info("Option file selected : " + path);
            } else {
                LOG.info("Closing Launch UI utility.");
                System.exit(0);
            }
        }
    } catch (ClassNotFoundException | UnsupportedLookAndFeelException | IllegalAccessException
            | InstantiationException e) {
        LOG.error(e.toString());
    }

    return path;
}

From source file:edu.harvard.i2b2.eclipse.plugins.patientMapping.views.PatientMappingView.java

/**
 * This is a callback that will allow us to create the viewer and initialize
 * it./* w  w  w.ja  v a  2s .c o  m*/
 */
@Override
public void createPartControl(Composite parent) {
    log.info("Patient Mapping plugin version 1.7.0");
    timelineComposite = parent;

    if (!(UserInfoBean.getInstance().isRoleInProject("DATA_LDS"))) {
        new NoAccessComposite(parent, SWT.NONE);
        return;
    }

    //explorer = new MainComposite(parent, false);*/

    Composite composite = new Composite(parent, SWT.EMBEDDED);

    /* Create and setting up frame */
    ////for mac fix
    //if ( System.getProperty("os.name").toLowerCase().startsWith("mac"))
    //SWT_AWT.embeddedFrameClass = "sun.lwawt.macosx.CViewEmbeddedFrame";
    Frame runFrame = SWT_AWT.new_Frame(composite);
    Panel runPanel = new Panel(new BorderLayout());
    try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) {
        System.out.println("Error setting native LAF: " + e);
    }

    runFrame.add(runPanel);
    JRootPane runRoot = new JRootPane();
    runPanel.add(runRoot);
    oAwtContainer = runRoot.getContentPane();

    runTreePanel = new PatientMappingJPanel(oAwtContainer);//PreviousQueryPanel(this);
    //runTreePanel.setBackground(Color.BLUE);

    oAwtContainer.add(runTreePanel);

    // Setup help context
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, PATIENTMAPPING_VIEW_CONTEXT_ID);
    addHelpButtonToToolBar();
}

From source file:accinapdf.ACCinaPDF.java

/**
 * @param args the command line arguments
 *///  w  ww .j a va  2 s  .c  om
public static void main(String[] args) {

    controller.Logger.create();
    controller.Bundle.getBundle();

    if (GraphicsEnvironment.isHeadless()) {
        // Headless
        // Erro 
        String fich;
        if (args.length != 1) {
            System.err.println(Bundle.getBundle().getString("invalidArgs"));
            return;
        } else {
            fich = args[0];
        }

        try {
            System.out.println(Bundle.getBundle().getString("validating") + " " + fich);
            ArrayList<SignatureValidation> alSv = CCInstance.getInstance().validatePDF(fich, null);
            if (alSv.isEmpty()) {
                System.out.println(Bundle.getBundle().getString("notSigned"));
            } else {
                String newLine = System.getProperty("line.separator");
                String toWrite = "(";
                int numSigs = alSv.size();
                if (numSigs == 1) {
                    toWrite += "1 " + Bundle.getBundle().getString("signature");
                } else {
                    toWrite += numSigs + " " + Bundle.getBundle().getString("signatures");
                }
                toWrite += ")" + newLine;
                for (SignatureValidation sv : alSv) {
                    toWrite += "\t" + sv.getName() + " - ";
                    toWrite += (sv.isCertification()
                            ? WordUtils.capitalize(Bundle.getBundle().getString("certificate"))
                            : WordUtils.capitalize(Bundle.getBundle().getString("signed"))) + " "
                            + Bundle.getBundle().getString("by") + " " + sv.getSignerName();
                    toWrite += newLine + "\t\t";
                    if (sv.isChanged()) {
                        toWrite += Bundle.getBundle().getString("certifiedChangedOrCorrupted");
                    } else {
                        if (sv.isCertification()) {
                            if (sv.isValid()) {
                                if (sv.isChanged() || !sv.isCoversEntireDocument()) {
                                    toWrite += Bundle.getBundle().getString("certifiedButChanged");
                                } else {
                                    toWrite += Bundle.getBundle().getString("certifiedOk");
                                }
                            } else {
                                toWrite += Bundle.getBundle().getString("changedAfterCertified");
                            }
                        } else {
                            if (sv.isValid()) {
                                if (sv.isChanged()) {
                                    toWrite += Bundle.getBundle().getString("signedButChanged");
                                } else {
                                    toWrite += Bundle.getBundle().getString("signedOk");
                                }
                            } else {
                                toWrite += Bundle.getBundle().getString("signedChangedOrCorrupted");
                            }
                        }
                    }
                    toWrite += newLine + "\t\t";
                    if (sv.getOcspCertificateStatus().equals(CertificateStatus.OK)
                            || sv.getCrlCertificateStatus().equals(CertificateStatus.OK)) {
                        toWrite += Bundle.getBundle().getString("certOK");
                    } else if (sv.getOcspCertificateStatus().equals(CertificateStatus.REVOKED)
                            || sv.getCrlCertificateStatus().equals(CertificateStatus.REVOKED)) {
                        toWrite += Bundle.getBundle().getString("certRevoked");
                    } else if (sv.getOcspCertificateStatus().equals(CertificateStatus.UNCHECKED)
                            && sv.getCrlCertificateStatus().equals(CertificateStatus.UNCHECKED)) {
                        toWrite += Bundle.getBundle().getString("certNotVerified");
                    } else if (sv.getOcspCertificateStatus().equals(CertificateStatus.UNCHAINED)) {
                        toWrite += Bundle.getBundle().getString("certNotChained");
                    } else if (sv.getOcspCertificateStatus().equals(CertificateStatus.EXPIRED)) {
                        toWrite += Bundle.getBundle().getString("certExpired");
                    } else if (sv.getOcspCertificateStatus().equals(CertificateStatus.CHAINED_LOCALLY)) {
                        toWrite += Bundle.getBundle().getString("certChainedLocally");
                    }
                    toWrite += newLine + "\t\t";
                    if (sv.isValidTimeStamp()) {
                        toWrite += Bundle.getBundle().getString("validTimestamp");
                    } else {
                        toWrite += Bundle.getBundle().getString("signerDateTime");
                    }
                    toWrite += newLine + "\t\t";

                    toWrite += WordUtils.capitalize(Bundle.getBundle().getString("revision")) + ": "
                            + sv.getRevision() + " " + Bundle.getBundle().getString("of") + " "
                            + sv.getNumRevisions();
                    toWrite += newLine + "\t\t";
                    final DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
                    final SimpleDateFormat sdf = new SimpleDateFormat("Z");
                    if (sv.getSignature().getTimeStampToken() == null) {
                        Calendar cal = sv.getSignature().getSignDate();
                        String date = sdf.format(cal.getTime().toLocaleString());
                        toWrite += date + " " + sdf.format(cal.getTime()) + " ("
                                + Bundle.getBundle().getString("signerDateTimeSmall") + ")";
                    } else {
                        Calendar ts = sv.getSignature().getTimeStampDate();
                        String date = df.format(ts.getTime());
                        toWrite += Bundle.getBundle().getString("date") + " " + date + " "
                                + sdf.format(ts.getTime());
                    }
                    toWrite += newLine + "\t\t";
                    boolean ltv = (sv.getOcspCertificateStatus() == CertificateStatus.OK
                            || sv.getCrlCertificateStatus() == CertificateStatus.OK);
                    toWrite += Bundle.getBundle().getString("isLtv") + ": "
                            + (ltv ? Bundle.getBundle().getString("yes") : Bundle.getBundle().getString("no"));
                    String reason = sv.getSignature().getReason();
                    toWrite += newLine + "\t\t";
                    toWrite += Bundle.getBundle().getString("reason") + ": ";
                    if (reason == null) {
                        toWrite += Bundle.getBundle().getString("notDefined");
                    } else if (reason.isEmpty()) {
                        toWrite += Bundle.getBundle().getString("notDefined");
                    } else {
                        toWrite += reason;
                    }
                    String location = sv.getSignature().getLocation();
                    toWrite += newLine + "\t\t";
                    toWrite += Bundle.getBundle().getString("location") + ": ";
                    if (location == null) {
                        toWrite += Bundle.getBundle().getString("notDefined");
                    } else if (location.isEmpty()) {
                        toWrite += Bundle.getBundle().getString("notDefined");
                    } else {
                        toWrite += location;
                    }
                    toWrite += newLine + "\t\t";
                    toWrite += Bundle.getBundle().getString("allowsChanges") + ": ";
                    try {
                        int certLevel = CCInstance.getInstance().getCertificationLevel(sv.getFilename());
                        if (certLevel == PdfSignatureAppearance.CERTIFIED_FORM_FILLING) {
                            toWrite += Bundle.getBundle().getString("onlyAnnotations");
                        } else if (certLevel == PdfSignatureAppearance.CERTIFIED_FORM_FILLING_AND_ANNOTATIONS) {
                            toWrite += Bundle.getBundle().getString("annotationsFormFilling");
                        } else if (certLevel == PdfSignatureAppearance.CERTIFIED_NO_CHANGES_ALLOWED) {
                            toWrite += Bundle.getBundle().getString("no");
                        } else {
                            toWrite += Bundle.getBundle().getString("yes");
                        }
                    } catch (IOException ex) {
                        controller.Logger.getLogger().addEntry(ex);
                    }
                    toWrite += newLine + "\t\t";
                    if (sv.getOcspCertificateStatus() == CertificateStatus.OK
                            || sv.getCrlCertificateStatus() == CertificateStatus.OK) {
                        toWrite += (Bundle.getBundle().getString("validationCheck1") + " "
                                + (sv.getOcspCertificateStatus() == CertificateStatus.OK
                                        ? Bundle.getBundle().getString("validationCheck2") + ": "
                                                + CCInstance.getInstance().getCertificateProperty(
                                                        sv.getSignature().getOcsp().getCerts()[0].getSubject(),
                                                        "CN")
                                                + " " + Bundle.getBundle().getString("at") + " "
                                                + df.format(sv.getSignature().getOcsp().getProducedAt())
                                        : (sv.getCrlCertificateStatus() == CertificateStatus.OK ? "CRL" : ""))
                                + (sv.getSignature().getTimeStampToken() != null
                                        ? Bundle.getBundle().getString("validationCheck3") + ": "
                                                + CCInstance.getInstance()
                                                        .getCertificateProperty(sv.getSignature()
                                                                .getTimeStampToken().getSID().getIssuer(), "O")
                                        : ""));
                    } else if (sv.getSignature().getTimeStampToken() != null) {
                        toWrite += (Bundle.getBundle().getString("validationCheck3") + ": "
                                + CCInstance.getInstance().getCertificateProperty(
                                        sv.getSignature().getTimeStampToken().getSID().getIssuer(), "O"));
                    }
                    toWrite += newLine;
                }

                System.out.println(toWrite);
                System.out.println(Bundle.getBundle().getString("validationFinished"));
            }
        } catch (IOException | DocumentException | GeneralSecurityException ex) {
            System.err.println(Bundle.getBundle().getString("validationError"));
            Logger.getLogger(ACCinaPDF.class.getName()).log(Level.SEVERE, null, ex);
        }

    } else {
        // GUI
        CCSignatureSettings defaultSettings = new CCSignatureSettings(false);
        if (SystemUtils.IS_OS_WINDOWS) {
            for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
                if ("Windows".equals(info.getName())) {
                    try {
                        UIManager.setLookAndFeel(info.getClassName());
                    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
                            | UnsupportedLookAndFeelException ex) {
                        Logger.getLogger(ACCinaPDF.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    break;
                }
            }
        } else if (SystemUtils.IS_OS_LINUX) {
            for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    try {
                        UIManager.setLookAndFeel(info.getClassName());
                    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
                            | UnsupportedLookAndFeelException ex) {
                        Logger.getLogger(ACCinaPDF.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    break;
                }
            }
        } else if (SystemUtils.IS_OS_MAC_OSX) {
            try {
                UIManager.setLookAndFeel("com.sun.java.swing.plaf.mac.MacLookAndFeel");
            } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
                    | UnsupportedLookAndFeelException ex) {
                Logger.getLogger(ACCinaPDF.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

        new SplashScreen().setVisible(true);
    }
}

From source file:SimpleInternalFrameDemo.java

public void actionPerformed(ActionEvent e) {
    String lnfName = null;//  w  w w  . ja v a2  s .  co  m
    if (e.getActionCommand().equals("Mac")) {
        lnfName = "com.apple.mrj.swing.MacLookAndFeel";
    } else if (e.getActionCommand().equals("Metal")) {
        lnfName = "javax.swing.plaf.metal.MetalLookAndFeel";
    } else if (e.getActionCommand().equals("Motif")) {
        lnfName = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
    } else if (e.getActionCommand().equals("Windows")) {
        lnfName = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
    } else {
        System.err.println("Unrecognized L&F request action: " + e.getActionCommand());
        return;
    }
    try {
        UIManager.setLookAndFeel(lnfName);
        SwingUtilities.updateComponentTreeUI(frame);
    } catch (UnsupportedLookAndFeelException ex1) {
        System.err.println("Unsupported LookAndFeel: " + lnfName);
    } catch (ClassNotFoundException ex2) {
        System.err.println("LookAndFeel class not found: " + lnfName);
    } catch (InstantiationException ex3) {
        System.err.println("Could not load LookAndFeel: " + lnfName);
    } catch (IllegalAccessException ex4) {
        System.err.println("Cannot use LookAndFeel: " + lnfName);
    }
}