ProgressBarDialog.java
上传用户:njlgjx
上传日期:2022-08-07
资源大小:9105k
文件大小:3k
源码类别:

图形图象

开发平台:

Java

  1. /*
  2.  * NewJDialog.java
  3.  *
  4.  * Created on 2008年7月22日, 下午2:31
  5.  */
  6. package com.mwq.map.frame;
  7. import com.mwq.map.tool.ScreenSize;
  8. /**
  9.  *
  10.  * @author  Administrator
  11.  */
  12. public class ProgressBarDialog extends javax.swing.JDialog {
  13.     /** Creates new form NewJDialog */
  14.     public ProgressBarDialog(java.awt.Frame parent, boolean modal) {
  15.         super(parent, modal);
  16.         initComponents();
  17.         ScreenSize.centered(this);
  18.     }
  19.     /** This method is called from within the constructor to
  20.      * initialize the form.
  21.      * WARNING: Do NOT modify this code. The content of this method is
  22.      * always regenerated by the Form Editor.
  23.      */
  24.     @SuppressWarnings("unchecked")
  25.     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  26.     private void initComponents() {
  27.         progressBar = new javax.swing.JProgressBar();
  28.         setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  29.         setAlwaysOnTop(true);
  30.         setUndecorated(true);
  31.         progressBar.setForeground(new java.awt.Color(255, 0, 0));
  32.         progressBar.setIndeterminate(true);
  33.         progressBar.setString("加载地图进行中...");
  34.         progressBar.setStringPainted(true);
  35.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  36.         getContentPane().setLayout(layout);
  37.         layout.setHorizontalGroup(
  38.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  39.             .addGroup(layout.createSequentialGroup()
  40.                 .addContainerGap()
  41.                 .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE)
  42.                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  43.         );
  44.         layout.setVerticalGroup(
  45.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  46.             .addGroup(layout.createSequentialGroup()
  47.                 .addContainerGap()
  48.                 .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  49.                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  50.         );
  51.         pack();
  52.     }// </editor-fold>                        
  53.     /**
  54.      * @param args the command line arguments
  55.      */
  56.     public static void main(String args[]) {
  57.         java.awt.EventQueue.invokeLater(new Runnable() {
  58.             public void run() {
  59.                 ProgressBarDialog dialog = new ProgressBarDialog(new javax.swing.JFrame(), true);
  60.                 dialog.addWindowListener(new java.awt.event.WindowAdapter() {
  61.                     @Override
  62.                     public void windowClosing(java.awt.event.WindowEvent e) {
  63.                         System.exit(0);
  64.                     }
  65.                 });
  66.                 dialog.setVisible(true);
  67.             }
  68.         });
  69.     }
  70.     // Variables declaration - do not modify                     
  71.     private javax.swing.JProgressBar progressBar;
  72.     // End of variables declaration                   
  73. }