Java Swing 创建转圈的进度提示框

Wesley13
• 阅读 602

Java Swing 创建转圈的进度提示框

摘自 https://blog.csdn.net/nihaoqiulinhe/article/details/52439486

置顶 2016年09月05日 13:40:07

阅读数:4104

     总是觉得Java Swing没有Android的好,不能自定义组件,实现漂亮的进度提示框,比如那种转圈的,谷歌了一下竟然发现有大牛实现了类似的额效果:Java Swing 创建转圈的进度提示框

      使用方法:

1.具体只需要两个类:AnimatedPanel.java, InfiniteProgressPanel.java,具体的内容如下:

     AnimatedPanel.java的代码如下:

        package com.jframe.ceshi;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        /*
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * Created on 25 juin 2004
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * AnimatedPanel.java
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * Panneau anim茅.
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         */
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.AlphaComposite;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.Color;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.Font;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.Graphics;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.Graphics2D;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.Image;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.RenderingHints;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.font.FontRenderContext;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.font.TextLayout;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.geom.Rectangle2D;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.image.BufferedImage;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.image.BufferedImageOp;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.image.ConvolveOp;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.image.Kernel;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import javax.swing.ImageIcon;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import javax.swing.JPanel;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        /**
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * Affiche un panneau anim茅. L'animation consiste en l'highlight d'une image.
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * 
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * @author Romain Guy
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         */
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        public 
        
        
        class AnimatedPanel extends JPanel {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        /**
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * 
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         */
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        private 
        
        
        static 
        
        
        final 
        
        
        long serialVersionUID = 
        
        
        1L;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        private 
        
        
        float gradient;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        private String message;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        private Thread animator;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        private BufferedImage convolvedImage;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        private BufferedImage originalImage;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        private Font font;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        private 
        
        
        static AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        /**
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * Cr茅e un panneau anim茅 contenant l'image pass茅e en param猫tre. L'animation
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * ne d茅marre que par un appel 脿 start().
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * 
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * @param message Le message 脿 afficher
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * @param icon L'image 脿 afficher et 脿 animer
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * @author Romain Guy
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         */
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public AnimatedPanel(String message, ImageIcon icon) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.message = message;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.font = getFont().deriveFont(
        
        
        14.0f);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                Image image = icon.getImage();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                originalImage = 
        
        
        new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                convolvedImage = 
        
        
        new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                Graphics g = originalImage.createGraphics();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                g.drawImage(image, 
        
        
        0, 
        
        
        0, 
        
        
        this);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                g.dispose();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                setBrightness(
        
        
        1.0f);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                setOpaque(
        
        
        false);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        @Override
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public void paintComponent(Graphics g) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        super.paintComponent(g);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        if (convolvedImage != 
        
        
        null) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        int width = getWidth();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        int height = getHeight();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        synchronized (convolvedImage) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        Graphics2D g2 = (Graphics2D) g;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        FontRenderContext context = g2.getFontRenderContext();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        TextLayout layout = 
        
        
        new TextLayout(message, font, context);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        Rectangle2D bounds = layout.getBounds();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                       
        
        
        int x = (width - convolvedImage.getWidth(
        
        
        null)) / 
        
        
        2;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                       
        
        
        int y = (
        
        
        int) (height - (convolvedImage.getHeight(
        
        
        null) + bounds.getHeight() + layout.getAscent())) / 
        
        
        2;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        g2.drawImage(convolvedImage, x, y, 
        
        
        this);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        g2.setColor(
        
        
        new Color(
        
        
        0, 
        
        
        0, 
        
        
        0, (
        
        
        int) (gradient * 
        
        
        255)));
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        layout.draw(g2, (
        
        
        float) (width - bounds.getWidth()) / 
        
        
        2,
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                                (
        
        
        float) (y + convolvedImage.getHeight(
        
        
        null) + bounds.getHeight() + layout.getAscent()));
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        /**
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * Modifie la luminosit茅 de l'image.
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * 
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * @param multiple Le taux de luminosit茅
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         */
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        private void setBrightness(float multiple) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        float[] brightKernel = { multiple };
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                RenderingHints hints = 
        
        
        new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                BufferedImageOp bright = 
        
        
        new ConvolveOp(
        
        
        new Kernel(
        
        
        1, 
        
        
        1, brightKernel), ConvolveOp.EDGE_NO_OP, hints);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                bright.filter(originalImage, convolvedImage);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                repaint();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        /**
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * Modifie le d茅grad茅 du texte.
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * 
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * @param gradient Le coefficient de d茅grad茅
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         */
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        private void setGradientFactor(float gradient) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.gradient = gradient;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        /**
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * D茅marre l'animation du panneau.
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         */
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public void start() {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.animator = 
        
        
        new Thread(
        
        
        new HighlightCycler(), 
        
        
        "Highlighter");
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.animator.start();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        /**
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * Arr锚te l'animation.
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         */
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public void stop() {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        if (
        
        
        this.animator != 
        
        
        null) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        this.animator.interrupt();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.animator = 
        
        
        null;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        /**
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * Fait cycler la valeur d'highlight de l'image.
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * 
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * @author Romain Guy
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         */
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        class HighlightCycler implements Runnable {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        private 
        
        
        int way = 
        
        
        1;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        private 
        
        
        final 
        
        
        int LOWER_BOUND = 
        
        
        10;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        private 
        
        
        final 
        
        
        int UPPER_BOUND = 
        
        
        35;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        private 
        
        
        int value = LOWER_BOUND;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        @Override
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        public void run() {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        while (
        
        
        true) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                       
        
        
        try {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                            Thread.sleep(
        
        
        1000 / (UPPER_BOUND - LOWER_BOUND));
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        } 
        
        
        catch (InterruptedException e) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                           
        
        
        return;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        value += 
        
        
        this.way;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                       
        
        
        if (value > UPPER_BOUND) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                            value = UPPER_BOUND;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                           
        
        
        this.way = -
        
        
        1;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        } 
        
        
        else 
        
        
        if (value < LOWER_BOUND) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                            value = LOWER_BOUND;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                           
        
        
        this.way = 
        
        
        1;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                       
        
        
        synchronized (convolvedImage) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                            setBrightness((
        
        
        float) value / 
        
        
        10);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                            setGradientFactor((
        
        
        float) value / UPPER_BOUND);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        }
       
       
       
      
      
      
    
    
    

    2. InfiniteProgressPanel.java代码如下:

        package com.jframe.ceshi;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.Color;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.Graphics;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.Graphics2D;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.RenderingHints;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.event.MouseEvent;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.event.MouseListener;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.font.FontRenderContext;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.font.TextLayout;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.geom.AffineTransform;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.geom.Area;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.geom.Ellipse2D;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.geom.Point2D;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import java.awt.geom.Rectangle2D;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        import javax.swing.JComponent;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        public 
        
        
        class InfiniteProgressPanel extends JComponent implements MouseListener {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        /**
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         * 
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
         */
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        private 
        
        
        static 
        
        
        final 
        
        
        long serialVersionUID = 
        
        
        1L;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        protected Area[] ticker = 
        
        
        null;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        protected Thread animation = 
        
        
        null;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        protected 
        
        
        boolean started = 
        
        
        false;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        protected 
        
        
        int alphaLevel = 
        
        
        0;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        protected 
        
        
        int rampDelay = 
        
        
        300;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        protected 
        
        
        float shield = 
        
        
        0.70f;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        protected String text = 
        
        
        "";
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        protected 
        
        
        int barsCount = 
        
        
        14;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        protected 
        
        
        float fps = 
        
        
        15.0f;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        protected RenderingHints hints = 
        
        
        null;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public InfiniteProgressPanel() {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this(
        
        
        "");
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public InfiniteProgressPanel(String text) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this(text, 
        
        
        14);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public InfiniteProgressPanel(String text, int barsCount) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this(text, barsCount, 
        
        
        0.70f);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public InfiniteProgressPanel(String text, int barsCount, float shield) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this(text, barsCount, shield, 
        
        
        15.0f);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public InfiniteProgressPanel(String text, int barsCount, float shield, float fps) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this(text, barsCount, shield, fps, 
        
        
        300);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public InfiniteProgressPanel(String text, int barsCount, float shield, float fps, int rampDelay) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.text = text;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.rampDelay = rampDelay >= 
        
        
        0 ? rampDelay : 
        
        
        0;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.shield = shield >= 
        
        
        0.0f ? shield : 
        
        
        0.0f;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.fps = fps > 
        
        
        0.0f ? fps : 
        
        
        15.0f;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.barsCount = barsCount > 
        
        
        0 ? barsCount : 
        
        
        14;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.hints = 
        
        
        new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.hints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.hints.put(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public void setText(String text) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                repaint();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        this.text = text;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public String getText() {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        return text;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public void start() {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                addMouseListener(
        
        
        this);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                setVisible(
        
        
        true);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                ticker = buildTicker();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                animation = 
        
        
        new Thread(
        
        
        new Animator(
        
        
        true));
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                animation.start();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public void stop() {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        if (animation != 
        
        
        null) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    animation.interrupt();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    animation = 
        
        
        null;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    animation = 
        
        
        new Thread(
        
        
        new Animator(
        
        
        false));
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    animation.start();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public void interrupt() {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        if (animation != 
        
        
        null) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    animation.interrupt();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    animation = 
        
        
        null;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    removeMouseListener(
        
        
        this);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    setVisible(
        
        
        false);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        @Override
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public void paintComponent(Graphics g) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        if (started) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        int width = getWidth();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        int height = getHeight();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        double maxY = 
        
        
        0.0;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    Graphics2D g2 = (Graphics2D) g;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    g2.setRenderingHints(hints);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    g2.setColor(
        
        
        new Color(
        
        
        255, 
        
        
        255, 
        
        
        255, (
        
        
        int) (alphaLevel * shield)));
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    g2.fillRect(
        
        
        0, 
        
        
        0, getWidth(), getHeight());
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        for (
        
        
        int i = 
        
        
        0; i < ticker.length; i++) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                       
        
        
        int channel = 
        
        
        224 - 
        
        
        128 / (i + 
        
        
        1);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        g2.setColor(
        
        
        new Color(channel, channel, channel, alphaLevel));
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        g2.fill(ticker[i]);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        Rectangle2D bounds = ticker[i].getBounds2D();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                       
        
        
        if (bounds.getMaxY() > maxY) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                            maxY = bounds.getMaxY();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        if (text != 
        
        
        null && text.length() > 
        
        
        0) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        FontRenderContext context = g2.getFontRenderContext();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        TextLayout layout = 
        
        
        new TextLayout(text, getFont(), context);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        Rectangle2D bounds = layout.getBounds();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        g2.setColor(getForeground());
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        layout.draw(g2, (
        
        
        float) (width - bounds.getWidth()) / 
        
        
        2,
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                                (
        
        
        float) (maxY + layout.getLeading() + 
        
        
        2 * layout.getAscent()));
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        private Area[] buildTicker() {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                Area[] ticker = 
        
        
        new Area[barsCount];
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                Point2D.Double center = 
        
        
        new Point2D.Double((
        
        
        double) getWidth() / 
        
        
        2, (
        
        
        double) getHeight() / 
        
        
        2);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        double fixedAngle = 
        
        
        2.0 * Math.PI / (barsCount);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        for (
        
        
        double i = 
        
        
        0.0; i < barsCount; i++) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    Area primitive = buildPrimitive();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    AffineTransform toCenter = AffineTransform.getTranslateInstance(center.getX(), center.getY());
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    AffineTransform toBorder = AffineTransform.getTranslateInstance(
        
        
        45.0, -
        
        
        6.0);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    AffineTransform toCircle = AffineTransform.getRotateInstance(-i * fixedAngle, center.getX(), center.getY());
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    AffineTransform toWheel = 
        
        
        new AffineTransform();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    toWheel.concatenate(toCenter);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    toWheel.concatenate(toBorder);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    primitive.transform(toWheel);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    primitive.transform(toCircle);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    ticker[(
        
        
        int) i] = primitive;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        return ticker;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        private Area buildPrimitive() {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                Rectangle2D.Double body = 
        
        
        new Rectangle2D.Double(
        
        
        6, 
        
        
        0, 
        
        
        30, 
        
        
        12);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                Ellipse2D.Double head = 
        
        
        new Ellipse2D.Double(
        
        
        0, 
        
        
        0, 
        
        
        12, 
        
        
        12);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                Ellipse2D.Double tail = 
        
        
        new Ellipse2D.Double(
        
        
        30, 
        
        
        0, 
        
        
        12, 
        
        
        12);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                Area tick = 
        
        
        new Area(body);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                tick.add(
        
        
        new Area(head));
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                tick.add(
        
        
        new Area(tail));
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        return tick;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        protected 
        
        
        class Animator implements Runnable {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        private 
        
        
        boolean rampUp = 
        
        
        true;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        protected Animator(boolean rampUp) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        this.rampUp = rampUp;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        @Override
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
               
        
        
        public void run() {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    Point2D.Double center = 
        
        
        new Point2D.Double((
        
        
        double) getWidth() / 
        
        
        2, (
        
        
        double) getHeight() / 
        
        
        2);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        double fixedIncrement = 
        
        
        2.0 * Math.PI / (barsCount);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    AffineTransform toCircle = AffineTransform.getRotateInstance(fixedIncrement, center.getX(), center.getY());
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        long start = System.currentTimeMillis();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        if (rampDelay == 
        
        
        0) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        alphaLevel = rampUp ? 
        
        
        255 : 
        
        
        0;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    started = 
        
        
        true;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        boolean inRamp = rampUp;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        while (!Thread.interrupted()) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                       
        
        
        if (!inRamp) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                           
        
        
        for (
        
        
        int i = 
        
        
        0; i < ticker.length; i++) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                                ticker[i].transform(toCircle);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        repaint();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                       
        
        
        if (rampUp) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                           
        
        
        if (alphaLevel < 
        
        
        255) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                                alphaLevel = (
        
        
        int) (
        
        
        255 * (System.currentTimeMillis() - start) / rampDelay);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                               
        
        
        if (alphaLevel >= 
        
        
        255) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                                    alphaLevel = 
        
        
        255;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                                    inRamp = 
        
        
        false;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                                }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        } 
        
        
        else 
        
        
        if (alphaLevel > 
        
        
        0) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                            alphaLevel = (
        
        
        int) (
        
        
        255 - (
        
        
        255 * (System.currentTimeMillis() - start) / rampDelay));
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                           
        
        
        if (alphaLevel <= 
        
        
        0) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                                alphaLevel = 
        
        
        0;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                               
        
        
        break;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                       
        
        
        try {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                            Thread.sleep(inRamp ? 
        
        
        10 : (
        
        
        int) (
        
        
        1000 / fps));
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        } 
        
        
        catch (InterruptedException ie) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                           
        
        
        break;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        Thread.yield();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
                   
        
        
        if (!rampUp) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        started = 
        
        
        false;
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        repaint();
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        setVisible(
        
        
        false);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                        removeMouseListener(InfiniteProgressPanel.
        
        
        this);
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                    }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
                }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        @Override
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public void mouseClicked(MouseEvent e) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        @Override
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public void mousePressed(MouseEvent e) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        @Override
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public void mouseReleased(MouseEvent e) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        @Override
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public void mouseEntered(MouseEvent e) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
        
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        @Override
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
           
        
        
        public void mouseExited(MouseEvent e) {
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
            }
       
       
       
      
      
      
     
     
     
      
      
      
       
       
       
      
      
      
      
      
      
       
       
       
        
        
        }
       
       
       
      
      
      
    
    
    

     3.如何在你的Java Swing使用呢,如下步骤:

JFrame frame = new JFrame(); // ... InfiniteProgressPanel glasspane = new InfiniteProgressPanel();

    Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();         glasspane.setBounds(100, 100, (dimension.width) / 2, (dimension.height) / 2); frame.setGlassPane(glasspane); glasspane.start();//开始动画加载效果 frame.setVisible(true);   // Later, to disable,在合适的地方关闭动画效果 glasspane.stop();

     参考的两个链接如下:

http://www.javalobby.org/java/forums/t19222.html,http://www.curious-creature.com/2005/02/15/wait-with-style-in-swing/

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
待兔 待兔
4个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Jacquelyn38 Jacquelyn38
3年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
Wesley13 Wesley13
3年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
3年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Stella981 Stella981
3年前
Docker 部署SpringBoot项目不香吗?
  公众号改版后文章乱序推荐,希望你可以点击上方“Java进阶架构师”,点击右上角,将我们设为★“星标”!这样才不会错过每日进阶架构文章呀。  !(http://dingyue.ws.126.net/2020/0920/b00fbfc7j00qgy5xy002kd200qo00hsg00it00cj.jpg)  2
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Java服务总在半夜挂,背后的真相竟然是... | 京东云技术团队
最近有用户反馈测试环境Java服务总在凌晨00:00左右挂掉,用户反馈Java服务没有定时任务,也没有流量突增的情况,Jvm配置也合理,莫名其妙就挂了
Python进阶者 Python进阶者
10个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这