Package uk.co.nimp.scardterminalmanager

Source Code of uk.co.nimp.scardterminalmanager.ScardTerminalManagerAboutBox

/*
* ScardTerminalManagerAboutBox.java
*/

package uk.co.nimp.scardterminalmanager;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import org.jdesktop.application.Action;

public class ScardTerminalManagerAboutBox extends javax.swing.JDialog {



    public ScardTerminalManagerAboutBox(java.awt.Frame parent) {
        super(parent);
        initComponents();


        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(uk.co.nimp.scardterminalmanager.ScardTerminalManagerApp.class).getContext().getResourceMap(ScardTerminalManagerAboutBox.class);

        Document doc=infoTextArea.getDocument();
        StringBuilder sb=new StringBuilder();
        sb.append("Product: ");
        sb.append(resourceMap.getString("appTitleLabel1.text"));
        sb.append("\nversion:      ");
        sb.append(resourceMap.getString("appVersionLabel1.text"));
        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("uk/co/nimp/scardterminalmanager/resources/BuildNumber"); // NOI18N
        sb.append("\nbuild number: ");
        sb.append(bundle.getString("build.number"));
        sb.append("\n\nJava properties:\n");
        Properties p=System.getProperties();
       
        for(Object key:p.keySet()){
            sb.append(key);
            sb.append(": ");
            sb.append(p.get(key));
            sb.append("\n");
        }
        try {
            doc.insertString(0, sb.toString(), null);
            infoTextArea.setCaretPosition(0);
        } catch (BadLocationException ex) {
            Logger.getLogger(ScardTerminalManagerAboutBox.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Action public void closeAboutBox() {
        dispose();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        javax.swing.JLabel appTitleLabel = new javax.swing.JLabel();
        javax.swing.JLabel appVersionLabel = new javax.swing.JLabel();
        javax.swing.JLabel appVendorLabel = new javax.swing.JLabel();
        javax.swing.JLabel appHomepageLabel = new javax.swing.JLabel();
        javax.swing.JLabel appDescLabel = new javax.swing.JLabel();
        javax.swing.JLabel imageLabel = new javax.swing.JLabel();
        javax.swing.JLabel appVendorLabel1 = new javax.swing.JLabel();
        javax.swing.JLabel vendorLabel = new javax.swing.JLabel();
        javax.swing.JLabel appTitleLabel1 = new javax.swing.JLabel();
        javax.swing.JLabel appVersionLabel1 = new javax.swing.JLabel();
        javax.swing.JLabel versionLabel = new javax.swing.JLabel();
        javax.swing.JLabel appHomepageLabel1 = new javax.swing.JLabel();
        javax.swing.JLabel homepageLabel = new javax.swing.JLabel();
        javax.swing.JLabel buildNumberLabel = new javax.swing.JLabel();
        javax.swing.JLabel appBuildNumberLabel = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        infoTextArea = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(uk.co.nimp.scardterminalmanager.ScardTerminalManagerApp.class).getContext().getResourceMap(ScardTerminalManagerAboutBox.class);
        setTitle(resourceMap.getString("title")); // NOI18N
        setModal(true);
        setName("aboutBox"); // NOI18N
        setResizable(false);

        appTitleLabel.setFont(appTitleLabel.getFont().deriveFont(appTitleLabel.getFont().getStyle() | java.awt.Font.BOLD, appTitleLabel.getFont().getSize()+4));
        appTitleLabel.setName("appTitleLabel"); // NOI18N

        appVersionLabel.setName("appVersionLabel"); // NOI18N

        appVendorLabel.setName("appVendorLabel"); // NOI18N

        appHomepageLabel.setName("appHomepageLabel"); // NOI18N

        appDescLabel.setText(resourceMap.getString("appDescLabel.text")); // NOI18N
        appDescLabel.setName("appDescLabel"); // NOI18N

        imageLabel.setIcon(resourceMap.getIcon("imageLabel.icon")); // NOI18N
        imageLabel.setName("imageLabel"); // NOI18N

        appVendorLabel1.setText(resourceMap.getString("appVendorLabel1.text")); // NOI18N
        appVendorLabel1.setName("appVendorLabel1"); // NOI18N

        vendorLabel.setFont(vendorLabel.getFont().deriveFont(vendorLabel.getFont().getStyle() | java.awt.Font.BOLD));
        vendorLabel.setText(resourceMap.getString("vendorLabel.text")); // NOI18N
        vendorLabel.setName("vendorLabel"); // NOI18N

        appTitleLabel1.setFont(appTitleLabel1.getFont().deriveFont(appTitleLabel1.getFont().getStyle() | java.awt.Font.BOLD, appTitleLabel1.getFont().getSize()+4));
        appTitleLabel1.setText(resourceMap.getString("appTitleLabel1.text")); // NOI18N
        appTitleLabel1.setName("appTitleLabel1"); // NOI18N

        appVersionLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        appVersionLabel1.setText(resourceMap.getString("appVersionLabel1.text")); // NOI18N
        appVersionLabel1.setName("appVersionLabel1"); // NOI18N

        versionLabel.setFont(versionLabel.getFont().deriveFont(versionLabel.getFont().getStyle() | java.awt.Font.BOLD));
        versionLabel.setText(resourceMap.getString("versionLabel.text")); // NOI18N
        versionLabel.setName("versionLabel"); // NOI18N

        appHomepageLabel1.setText(resourceMap.getString("appHomepageLabel1.text")); // NOI18N
        appHomepageLabel1.setName("appHomepageLabel1"); // NOI18N

        homepageLabel.setFont(homepageLabel.getFont().deriveFont(homepageLabel.getFont().getStyle() | java.awt.Font.BOLD));
        homepageLabel.setText(resourceMap.getString("homepageLabel.text")); // NOI18N
        homepageLabel.setName("homepageLabel"); // NOI18N

        buildNumberLabel.setFont(buildNumberLabel.getFont().deriveFont(buildNumberLabel.getFont().getStyle() | java.awt.Font.BOLD));
        buildNumberLabel.setText(resourceMap.getString("buildNumberLabel.text")); // NOI18N
        buildNumberLabel.setName("buildNumberLabel"); // NOI18N

        appBuildNumberLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("uk/co/nimp/scardterminalmanager/resources/BuildNumber"); // NOI18N
        appBuildNumberLabel.setText(bundle.getString("build.number")); // NOI18N
        appBuildNumberLabel.setName("appBuildNumberLabel"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        infoTextArea.setColumns(20);
        infoTextArea.setEditable(false);
        infoTextArea.setRows(5);
        infoTextArea.setName("infoTextArea"); // NOI18N
        jScrollPane1.setViewportView(infoTextArea);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 615, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(appTitleLabel))
                        .addComponent(appVersionLabel, javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(appVendorLabel, javax.swing.GroupLayout.Alignment.TRAILING))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(appDescLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 283, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(versionLabel)
                                .addGap(18, 18, 18)
                                .addComponent(appVersionLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(buildNumberLabel)
                                .addGap(18, 18, 18)
                                .addComponent(appBuildNumberLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(vendorLabel)
                                .addGap(28, 28, 28)
                                .addComponent(appVendorLabel1))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(homepageLabel)
                                .addGap(6, 6, 6)
                                .addComponent(appHomepageLabel1))))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(imageLabel)
                        .addGap(18, 18, 18)
                        .addComponent(appTitleLabel1)))
                .addContainerGap(13, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(imageLabel)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(29, 29, 29)
                        .addComponent(appTitleLabel1)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(appDescLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(6, 6, 6)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(versionLabel)
                    .addComponent(appVersionLabel1))
                .addGap(6, 6, 6)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(buildNumberLabel)
                    .addComponent(appBuildNumberLabel))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(vendorLabel)
                    .addComponent(appVendorLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(homepageLabel)
                    .addComponent(appHomepageLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(appTitleLabel)
                        .addGap(26, 26, 26))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 326, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addComponent(appVersionLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(appVendorLabel)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextArea infoTextArea;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables
   
}
TOP

Related Classes of uk.co.nimp.scardterminalmanager.ScardTerminalManagerAboutBox

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.