Package way2sms

Source Code of way2sms.UpdateNotifier

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* UpdateNotifier.java
*
* Created on Oct 2, 2011, 7:28:27 AM
*/
package way2sms;

import java.awt.Cursor;
import java.awt.Desktop;
import java.net.URI;
import javax.swing.UIManager;

/**
*
* @author Dinesh
*/
public class UpdateNotifier extends javax.swing.JFrame {

   
    public static UpdateNotifier un;
    /** Creates new form UpdateNotifier */
    public UpdateNotifier() {
        initComponents();
        this.setAlwaysOnTop(Settings.istop);
        versionlbl.setText("Version "+Way2SMSCore.latestversion);
    }

    /** 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.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        versionlbl = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        downloadlbl = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();

        setTitle("Update Notifier");
        setResizable(false);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/image_resources/way2smsclient_logo_200px.png"))); // NOI18N

        versionlbl.setFont(new java.awt.Font("Arial", 1, 11));
        versionlbl.setText("Version 0.4");

        jLabel2.setFont(new java.awt.Font("Arial", 0, 11));
        jLabel2.setText("You want my latest version? Go ahead,");

        downloadlbl.setFont(new java.awt.Font("Arial", 0, 11));
        downloadlbl.setText("<html><font color=\"#0000FF\"><u>Download</u></font></html> ");
        downloadlbl.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                downloadlblMouseClicked(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Arial", 0, 11));
        jLabel3.setText("Hey friend, I'm updated. :) ");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(76, 76, 76)
                        .addComponent(versionlbl))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(79, 79, 79)
                        .addComponent(downloadlbl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel2))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel3))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel1)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(versionlbl)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(downloadlbl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        downloadlbl.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void downloadlblMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_downloadlblMouseClicked
        // TODO add your handling code here:
        if (Desktop.isDesktopSupported()) {
            Desktop desktop = Desktop.getDesktop();
            if (desktop.isSupported(Desktop.Action.BROWSE)) {
                try {
                    desktop.browse(new URI(Way2SMSCore.downloadlink));
                } catch (Exception e) {
                    System.out.println(e);
                }

            }
        }
    }//GEN-LAST:event_downloadlblMouseClicked

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
        }

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new UpdateNotifier().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel downloadlbl;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    public javax.swing.JLabel versionlbl;
    // End of variables declaration//GEN-END:variables
}
TOP

Related Classes of way2sms.UpdateNotifier

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.