Package javax.swing

Examples of javax.swing.Timer.addActionListener()


          return;
        }

        final Timer timer = new Timer(100, null);
        final Mote mote = (Mote) obj;
        timer.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            /* Count down */
            if (timer.getDelay() < 90) {
              timer.stop();
              highlightedMotes.remove(mote);
View Full Code Here


            {
                // Wait 1 sec and remove the progress bar from the main panel.
                Timer progressBarTimer = new Timer(1 * 1000, null);

                progressBarTimer.setRepeats(false);
                progressBarTimer.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e)
                    {
                        mainPanel.remove(progressBar);
                        mainPanel.add(readyLabel, BorderLayout.SOUTH);
                        mainPanel.revalidate();
View Full Code Here

        this.label = this;
        final Timer timer = new Timer(20, null);
        this.alpha = 0;
        float ileCykli = howLong/20;
        final double oIle = (float) ((alpha - this.getAlpha())/ileCykli);
        timer.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (label.getAlpha() < alpha) {
                    label.setAlpha((float) (label.getAlpha()+oIle));
                    Color c = label.getForeground();
View Full Code Here

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

        this.label = this;
        final Timer timer = new Timer(20, null);
//        this.alpha = this.getAlpha();
        float ileCykli = howLong/20;
        final double oIle = (float) ((alpha - this.alpha)/ileCykli);
        timer.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (label.getAlpha() > alpha) {
                    label.setAlpha((float) (label.getAlpha()+oIle));
                    Color c = label.getForeground();
View Full Code Here

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

        final Timer timer = new Timer(20, null);
        final float ileCykli = howLong/20;
        final double oIleR = (double)(this.getForeground().getRed()-color.getRed())/ileCykli;
        final double oIleG = (double)(this.getForeground().getGreen()-color.getGreen())/ileCykli;
        final double oIleB = (double)(this.getForeground().getBlue()-color.getBlue())/ileCykli;
        timer.addActionListener(new ActionListener() {
            float cykl = 0;
            @Override
            public void actionPerformed(ActionEvent e) {
                double actualR = label.getForeground().getRed();
                double actualG = label.getForeground().getGreen();
View Full Code Here

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

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

    public void fadeBackgroundIn(final int alpha, final int howLong) {
        this.label = this;
        final Timer timer = new Timer(20, null);
        float ileCykli = howLong/20;
        final double oIle = (float) ((alpha - this.getBackground().getAlpha())/ileCykli);
        timer.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (label.fadebackgroundInStop == true) {
                    timer.stop();
                    label.fadebackgroundInStop = false;
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.