/*
 * WaitDialog.java
 *
 * Created on January 19, 2006, 3:31 PM
 */

package phex.gui.common;

/**
 *
 * @author  manu
 */
public class WaitDialog extends javax.swing.JDialog implements Runnable{
    
    /** Creates new form WaitDialog */
    public WaitDialog(javax.swing.JFrame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        jProgressBar1.setIndeterminate(true);
    }
    
    /** 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() {
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jProgressBar1 = new javax.swing.JProgressBar();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Wait...");
        setResizable(false);
        jPanel1.setLayout(null);

        jLabel1.setText("Launching please wait....");
        jPanel1.add(jLabel1);
        jLabel1.setBounds(10, 10, 130, 14);

        jPanel1.add(jProgressBar1);
        jProgressBar1.setBounds(10, 30, 130, 16);

        getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-160)/2, (screenSize.height-90)/2, 160, 90);
    }
    // </editor-fold>//GEN-END:initComponents
    
    public void run() {
        setVisible(true);
        try{
            Thread.currentThread().sleep(1000);
        } catch(Exception e) {
            e.printStackTrace();
        }
        setVisible(false);
        dispose();
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JProgressBar jProgressBar1;
    // End of variables declaration//GEN-END:variables
    
}
