Package javax.swing

Examples of javax.swing.Timer.stop()


        // have to stop the timer at the end
        frame.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                timer.stop();
            }
        });

        // get graphics device
        GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
View Full Code Here


        // have to stop the timer at the end
        frame.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                timer.stop();
            }
        });

        // button for resetting
        JButton button0 = new JButton("reset");
View Full Code Here

                    int b = c.getBlue();
                    double a = label.getAlpha();
                    if (label.getAlpha() > 1) label.setAlpha(1);
                    label.setForeground(new Color(r,g,b));
                } else {
                    timer.stop();
                    if (fID != null) fID.actionPerformed(e);
                    fID = null;
                }
            }
        });
View Full Code Here

        final Timer pTimer = new Timer(ileCzekac, null);
        pTimer.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                fadeIn(alpha, howLong);
                pTimer.stop();
            }
        });
        pTimer.start();
    }
   
View Full Code Here

                    if (label.getAlpha() < 0) label.setAlpha(0);
                    int b = c.getBlue();
                    double a = label.getAlpha();
                    label.setForeground(new Color(r,g,b));
                } else {
                    timer.stop();
                    if (fOD != null) fOD.actionPerformed(e);
                    fOD = null;
                }
            }
        });
View Full Code Here

        final Timer pTimer = new Timer(ileCzekac, null);
        pTimer.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                fadeOut(alpha, howLong);
                pTimer.stop();
            }
        });
        pTimer.start();
    }
   
View Full Code Here

            public void actionPerformed(ActionEvent e) {
                double actualR = label.getForeground().getRed();
                double actualG = label.getForeground().getGreen();
                double actualB = label.getForeground().getBlue();
                if (changeForegroundStop == true) {
                    timer.stop();
                    changeForegroundStop = false;
                }
                if (cykl < ileCykli) {
                    cykl+=1;
                    actualR-=oIleR;
View Full Code Here

                    if (actualR<0)actualR=0;
                    if (actualG<0)actualG=0;
                    if (actualB<0)actualB=0;
                    label.setForeground(new Color((int)actualR, (int)actualG, (int)actualB));
                } else {
                    timer.stop();
                    if (cFD != null) cFD.actionPerformed(e);
                    cFD = null;
                }
            }
        });
View Full Code Here

        final Timer pTimer = new Timer(ileCzekac, null);
        pTimer.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                changeForegroundColor(color, howLong);
                pTimer.stop();
            }
        });
        pTimer.start();
    }
   
View Full Code Here

        final Timer pTimer = new Timer(20, null);
        pTimer.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                changeForegroundStop = false;
                pTimer.stop();
            }
        });
        pTimer.start();
    }
   
View Full Code Here

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