Package javax.swing

Examples of javax.swing.Timer.addActionListener()


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


    public void fadeBackgroundOut(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.fadebackgroundOutStop == true) {
                    timer.stop();
                    label.fadebackgroundOutStop = false;
View Full Code Here

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

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

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

        timer.start();
    }
   
    public void appear(final float doIlu, final int jakiCzas, final int ileCzekac) {
        final Timer pTimer = new Timer(ileCzekac, null);
        pTimer.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                appear(doIlu, jakiCzas);
                pTimer.stop();
            }
View Full Code Here

        timer.start();
    }
   
    public void disappear(final float doIlu, final int jakiCzas, final int ileCzekac) {
        final Timer pTimer = new Timer(ileCzekac, null);
        pTimer.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                disappear(doIlu, jakiCzas);
                pTimer.stop();
            }
View Full Code Here

        }
    }
   
    public void appear(final float doIlu, final int jakiCzas, final int ileCzekac) {
        final Timer pTimer = new Timer(ileCzekac, null);
        pTimer.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                appear(doIlu, jakiCzas);
                pTimer.stop();
            }
View Full Code Here

        }
    }
   
    public void disappear(final float doIlu, final int jakiCzas, final int ileCzekac) {
        final Timer pTimer = new Timer(ileCzekac, null);
        pTimer.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                disappear(doIlu, jakiCzas);
                pTimer.stop();
            }
View Full Code Here

   
    private static final int SLIDE_INTERVAL = 1000/30;
    /** Animate the ghosted image returning to its origin. */
    public void returnToOrigin() {
        final Timer timer = new Timer(SLIDE_INTERVAL, null);
        timer.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                Point location = dragImage.getLocationOnScreen();
                Point dst = new Point(origin);
                int dx = (dst.x - location.x)/2;
                int dy = (dst.y - location.y)/2;
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.