Juallah Kepandaianmu dan Belilah Kebingungan!

contoh penggunaan EecchhooFx

Posted in Java Programming by Eko Kurniawan Khannedy on 17 November 2008

untuk memudahkan penggunaan EecchhooFx, sekarang gw kasih contoh-contoh penggunaan EecchhooFx untuk tiap-tiap class yang memiliki parent class Fx.

contoh yang gw buat ada sekitar 17 contoh, mudah-mudahan lo pada ngerti cara pake EecchhooFx kalo udah liat contoh penggunaanya :D

sebelumnya download dulu project EecchhooFx di :

setelah itu baru praktekin seluruh contoh dibawah in :

  • AngleDynamicHorizontalSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.angle;
    
    import java.awt.Point;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.angle.AngleDynamicHorizontalFx;
    
    /**
     *
     * @author echo
     */
    public class AngleDynamicHorizontalSample extends JFrame {
    
        private static final long serialVersionUID = 1L;
    
        private Fx fx;
    
        public AngleDynamicHorizontalSample() {
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(400, 400);
            setLocationRelativeTo(null);
        }
    
        @Override
        public void setVisible(boolean b) {
            if (b) {
                fx = new AngleDynamicHorizontalFx(getLocation(), new Point());
                fx.setComponent(this);
                super.setVisible(b);
                fx.runFx();
            } else {
                super.setVisible(b);
            }
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new AngleDynamicHorizontalSample().setVisible(true);
                }
            });
        }
    }
    
  • AngleDynamicVerticalSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.angle;
    
    import java.awt.Point;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.angle.AngleDynamicVerticalFx;
    
    /**
     *
     * @author echo
     */
    public class AngleDynamicVerticalSample extends JFrame {
    
        private static final long serialVersionUID = 1L;
    
        private Fx fx;
    
        public AngleDynamicVerticalSample() {
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(400, 400);
            setLocationRelativeTo(null);
        }
    
        @Override
        public void setVisible(boolean b) {
            if (b) {
                fx = new AngleDynamicVerticalFx(getLocation(), new Point());
                fx.setComponent(this);
                super.setVisible(b);
                fx.runFx();
            } else {
                super.setVisible(b);
            }
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new AngleDynamicVerticalSample().setVisible(true);
                }
            });
        }
    }
    
  • AngleToHorizontalSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.angle;
    
    import java.awt.Point;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.angle.AngleDynamicHorizontalFx;
    import org.eecchhoo.fx.effect.angle.AngleToHorizontalFx;
    
    /**
     *
     * @author echo
     */
    public class AngleToHorizontalSample extends JFrame {
    
        private static final long serialVersionUID = 1L;
    
        private Fx fx;
    
        public AngleToHorizontalSample() {
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(400, 400);
        }
    
        @Override
        public void setVisible(boolean b) {
            if (b) {
                fx = new AngleToHorizontalFx(new Point(500, 500));
                fx.setComponent(this);
                super.setVisible(b);
                fx.runFx();
            } else {
                super.setVisible(b);
            }
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new AngleToHorizontalSample().setVisible(true);
                }
            });
        }
    }
    
  • AngleToVerticalSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.angle;
    
    import java.awt.Point;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.angle.AngleToVerticalFx;
    
    /**
     *
     * @author echo
     */
    public class AngleToVerticalSample extends JFrame {
    
        private static final long serialVersionUID = 1L;
    
        private Fx fx;
    
        public AngleToVerticalSample() {
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(400, 400);
        }
    
        @Override
        public void setVisible(boolean b) {
            if (b) {
                fx = new AngleToVerticalFx(new Point(500, 500));
                fx.setComponent(this);
                super.setVisible(b);
                fx.runFx();
            } else {
                super.setVisible(b);
            }
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new AngleToVerticalSample().setVisible(true);
                }
            });
        }
    }
    
  • ColorSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.custom;
    
    import java.awt.Color;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.effect.custom.ColorFx;
    import org.eecchhoo.fx.effect.custom.component.ColorComponent;
    
    /**
     *
     * @author echo
     */
    public class ColorSample extends JFrame implements ActionListener, ColorComponent {
    
        private static final long serialVersionUID = 1L;
    
        private JButton button;
    
        private ColorFx fx;
    
        public ColorSample() {
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(400, 400);
            setLocationRelativeTo(null);
    
            button = new JButton("show color fx");
            button.addActionListener(this);
    
            fx = new ColorFx();
            fx.setComponent(this);
            fx.setColors(getBackground(), Color.RED, Color.BLUE, Color.GREEN, Color.YELLOW, getBackground());
    
            getContentPane().setLayout(new FlowLayout());
            getContentPane().add(button);
        }
    
        public void actionPerformed(ActionEvent e) {
            fx.runFx();
        }
    
        public void setColorFx(Color color) {
            getContentPane().setBackground(color);
        }
    
        public Color getColorFx() {
            return getContentPane().getBackground();
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new ColorSample().setVisible(true);
                }
            });
        }
    }
    
  • MoveDynamicSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.move;
    
    import java.awt.Point;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.move.MoveDynamicFx;
    
    /**
     *
     * @author echo
     */
    public class MoveDynamicSample extends JFrame {
    
        private static final long serialVersionUID = 1L;
        private Fx fx;
    
        public MoveDynamicSample() {
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(400, 400);
            setLocationRelativeTo(null);
        }
    
        @Override
        public void setVisible(boolean b) {
            if(b){
                fx = new MoveDynamicFx(getLocation(), new Point());
                fx.setComponent(this);
                super.setVisible(b);
                fx.runFx();
            }else{
                super.setVisible(b);
            }
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new MoveDynamicSample().setVisible(true);
                }
            });
        }
    }
    
  • MoveHorizontalDownSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.move;
    
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.move.MoveHorizontalDownFx;
    
    /**
     *
     * @author echo
     */
    public class MoveHorizontalDownSample extends JFrame {
    
        private static final long serialVersionUID = 1L;
    
        private Fx fx;
    
        public MoveHorizontalDownSample() {
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(400, 400);
            setLocationRelativeTo(null);
            setLocation(getLocation().x, -500);
        }
    
        @Override
        public void setVisible(boolean b) {
            if (b) {
                fx = new MoveHorizontalDownFx(700);
                fx.setComponent(this);
                super.setVisible(b);
                fx.runFx();
            } else {
                super.setVisible(b);
            }
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new MoveHorizontalDownSample().setVisible(true);
                }
            });
        }
    }
    
  • MoveHorizontalUpSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.move;
    
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.move.MoveHorizontalUpFx;
    
    /**
     *
     * @author echo
     */
    public class MoveHorizontalUpSample extends JFrame {
    
        private static final long serialVersionUID = 1L;
    
        private Fx fx;
    
        public MoveHorizontalUpSample() {
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(400, 400);
            setLocationRelativeTo(null);
            setLocation(getLocation().x, 800);
        }
    
        @Override
        public void setVisible(boolean b) {
            if (b) {
                fx = new MoveHorizontalUpFx(700);
                fx.setComponent(this);
                super.setVisible(b);
                fx.runFx();
            } else {
                super.setVisible(b);
            }
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new MoveHorizontalUpSample().setVisible(true);
                }
            });
        }
    }
    
  • MoveVerticalLeftSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.move;
    
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.move.MoveHorizontalUpFx;
    import org.eecchhoo.fx.effect.move.MoveVerticalLeftFx;
    import org.eecchhoo.fx.effect.move.MoveVerticalRightFx;
    
    /**
     *
     * @author echo
     */
    public class MoveVerticalLeftSample extends JFrame {
    
        private static final long serialVersionUID = 1L;
    
        private Fx fx;
    
        public MoveVerticalLeftSample() {
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(400, 400);
            setLocationRelativeTo(null);
            setLocation(1500, getLocation().y);
        }
    
        @Override
        public void setVisible(boolean b) {
            if (b) {
                fx = new MoveVerticalLeftFx(1000);
                fx.setComponent(this);
                super.setVisible(b);
                fx.runFx();
            } else {
                super.setVisible(b);
            }
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new MoveVerticalLeftSample().setVisible(true);
                }
            });
        }
    }
    
  • MoveVerticalRightSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.move;
    
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.move.MoveHorizontalUpFx;
    import org.eecchhoo.fx.effect.move.MoveVerticalRightFx;
    
    /**
     *
     * @author echo
     */
    public class MoveVerticalRightSample extends JFrame {
    
        private static final long serialVersionUID = 1L;
    
        private Fx fx;
    
        public MoveVerticalRightSample() {
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(400, 400);
            setLocationRelativeTo(null);
            setLocation(-500, getLocation().y);
        }
    
        @Override
        public void setVisible(boolean b) {
            if (b) {
                fx = new MoveVerticalRightFx(800);
                fx.setComponent(this);
                super.setVisible(b);
                fx.runFx();
            } else {
                super.setVisible(b);
            }
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new MoveVerticalRightSample().setVisible(true);
                }
            });
        }
    }
    
  • ShakeDiagonalDownSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.shake;
    
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPasswordField;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.shake.ShakeDiagonalDownFx;
    
    /**
     *
     * @author echo
     */
    public class ShakeDiagonalDownSample extends JFrame implements ActionListener {
    
        private static final long serialVersionUID = 1L;
    
        private JPasswordField passwordField;
    
        private JButton button;
    
        private Fx fx;
    
        public ShakeDiagonalDownSample() {
            setTitle("contoh shake fx");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
            passwordField = new JPasswordField();
            passwordField.addActionListener(this);
    
            button = new JButton("login...");
            button.addActionListener(this);
    
            getContentPane().setLayout(null);
            getContentPane().add(passwordField);
            getContentPane().add(button);
    
            passwordField.setBounds(10, 10, 200, 40);
            button.setBounds(10, 55, 100, 40);
    
            setSize(400, 400);
            setLocationRelativeTo(null);
    
            // membuat fx menjadi shake horizontal
            fx = new ShakeDiagonalDownFx();
            // menset komponen fx ke form
            fx.setComponent(this);
        }
    
        public void actionPerformed(ActionEvent e) {
            // menjalankan fx
            fx.runFx();
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new ShakeDiagonalDownSample().setVisible(true);
                }
            });
        }
    }
    
  • ShakeDiagonalUpSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.shake;
    
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPasswordField;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.shake.ShakeDiagonalDownFx;
    import org.eecchhoo.fx.effect.shake.ShakeDiagonalUpFx;
    
    /**
     *
     * @author echo
     */
    public class ShakeDiagonalUpSample extends JFrame implements ActionListener {
    
        private static final long serialVersionUID = 1L;
    
        private JPasswordField passwordField;
    
        private JButton button;
    
        private Fx fx;
    
        public ShakeDiagonalUpSample() {
            setTitle("contoh shake fx");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
            passwordField = new JPasswordField();
            passwordField.addActionListener(this);
    
            button = new JButton("login...");
            button.addActionListener(this);
    
            getContentPane().setLayout(null);
            getContentPane().add(passwordField);
            getContentPane().add(button);
    
            passwordField.setBounds(10, 10, 200, 40);
            button.setBounds(10, 55, 100, 40);
    
            setSize(400, 400);
            setLocationRelativeTo(null);
    
            // membuat fx menjadi shake horizontal
            fx = new ShakeDiagonalUpFx();
            // menset komponen fx ke form
            fx.setComponent(this);
        }
    
        public void actionPerformed(ActionEvent e) {
            // menjalankan fx
            fx.runFx();
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new ShakeDiagonalUpSample().setVisible(true);
                }
            });
        }
    }
    
  • ShakeHorizontalSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.shake;
    
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPasswordField;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.shake.ShakeDiagonalDownFx;
    import org.eecchhoo.fx.effect.shake.ShakeHorizontalFx;
    import org.eecchhoo.fx.effect.shake.ShakeVerticalFx;
    
    /**
     *
     * @author echo
     */
    public class ShakeHorizontalSample extends JFrame implements ActionListener {
    
        private static final long serialVersionUID = 1L;
    
        private JPasswordField passwordField;
    
        private JButton button;
    
        private Fx fx;
    
        public ShakeHorizontalSample() {
            setTitle("contoh shake fx");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
            passwordField = new JPasswordField();
            passwordField.addActionListener(this);
    
            button = new JButton("login...");
            button.addActionListener(this);
    
            getContentPane().setLayout(null);
            getContentPane().add(passwordField);
            getContentPane().add(button);
    
            passwordField.setBounds(10, 10, 200, 40);
            button.setBounds(10, 55, 100, 40);
    
            setSize(400, 400);
            setLocationRelativeTo(null);
    
            // membuat fx menjadi shake horizontal
            fx = new ShakeVerticalFx();
            // menset komponen fx ke form
            fx.setComponent(this);
        }
    
        public void actionPerformed(ActionEvent e) {
            // menjalankan fx
            fx.runFx();
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new ShakeHorizontalSample().setVisible(true);
                }
            });
        }
    }
    
  • ShakeVerticalSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.shake;
    
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPasswordField;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.shake.ShakeDiagonalDownFx;
    
    /**
     *
     * @author echo
     */
    public class ShakeVerticalSample extends JFrame implements ActionListener {
    
        private static final long serialVersionUID = 1L;
    
        private JPasswordField passwordField;
    
        private JButton button;
    
        private Fx fx;
    
        public ShakeVerticalSample() {
            setTitle("contoh shake fx");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
            passwordField = new JPasswordField();
            passwordField.addActionListener(this);
    
            button = new JButton("login...");
            button.addActionListener(this);
    
            getContentPane().setLayout(null);
            getContentPane().add(passwordField);
            getContentPane().add(button);
    
            passwordField.setBounds(10, 10, 200, 40);
            button.setBounds(10, 55, 100, 40);
    
            setSize(400, 400);
            setLocationRelativeTo(null);
    
            // membuat fx menjadi shake horizontal
            fx = new ShakeDiagonalDownFx();
            // menset komponen fx ke form
            fx.setComponent(this);
        }
    
        public void actionPerformed(ActionEvent e) {
            // menjalankan fx
            fx.runFx();
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new ShakeVerticalSample().setVisible(true);
                }
            });
        }
    }
    
  • SizeAllSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.size;
    
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.size.SizeAllFx;
    
    /**
     *
     * @author echo
     */
    public class SizeAllSample extends JFrame implements ActionListener {
    
        private static final long serialVersionUID = 1L;
    
        private JButton button;
    
        private Fx fx;
    
        public SizeAllSample() {
            setTitle("Animasi Ukuran");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            // membaut button
            button = new JButton("Jalankan Animasi");
            // menambahkan action
            button.addActionListener(this);
            // menambahkan button
            getContentPane().setLayout(new FlowLayout());
            getContentPane().add(button);
            // membuat fx menjadi SizeAllFx
            fx = new SizeAllFx(800, 640);
            fx.setComponent(this);
            // mengubah ukuran awal form
            setSize(400, 400);
            // menjadikan form ditengah layar
            setLocationRelativeTo(null);
        }
    
        public void actionPerformed(ActionEvent e) {
            fx.runFx();
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new SizeAllSample().setVisible(true);
                }
            });
        }
    }
    
  • SizeHeightSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.size;
    
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.size.SizeHeightFx;
    
    /**
     *
     * @author echo
     */
    public class SizeHeightSample extends JFrame implements ActionListener {
    
        private static final long serialVersionUID = 1L;
    
        private JButton button;
    
        private Fx fx;
    
        public SizeHeightSample() {
            setTitle("Animasi Ukuran");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            // membaut button
            button = new JButton("Jalankan Animasi");
            // menambahkan action
            button.addActionListener(this);
            // menambahkan button
            getContentPane().setLayout(new FlowLayout());
            getContentPane().add(button);
            // membuat fx menjadi SizeAllFx
            fx = new SizeHeightFx(750);
            fx.setComponent(this);
            // mengubah ukuran awal form
            setSize(400, 400);
            // menjadikan form ditengah layar
            setLocationRelativeTo(null);
        }
    
        public void actionPerformed(ActionEvent e) {
            fx.runFx();
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new SizeHeightSample().setVisible(true);
                }
            });
        }
    }
    
  • SizeWidthSample.java
    /*
     *  DILARANG MENGUBAH ATAU MENGHAPUS HAK CIPTA INI.
     *
     *  Hak Cipta 2008 Eko Kurniawan Khannedy.
     *
     *  Semua isi dalam file ini adalah hak milik dari Eko Kurniawan Khannedy.
     *  Anda tak diperkenankan untuk menggunakan file atau mengubah file ini
     *  kecuali Anda tidak menghapus atau merubah hak cipta ini.
     *
     *  Pemilik tidak bertanggung jawab jika Anda menyalah gunakan file ini
     *  dan Pemilik TIDAK MENJAMIN apapun atas file ini.
     *
     *  Anda bisa menghubungi pemilik hak cipta ini di :
     *  email : echo.khannedy@gmail.com
     *  blog : http://eecchhoo.wordpress.com/
     *  ym : echo_khannedy
     */
    package org.eecchhoo.fx.sample.size;
    
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.size.SizeHeightFx;
    import org.eecchhoo.fx.effect.size.SizeWidthFx;
    
    /**
     *
     * @author echo
     */
    public class SizeWidthSample extends JFrame implements ActionListener {
    
        private static final long serialVersionUID = 1L;
    
        private JButton button;
    
        private Fx fx;
    
        public SizeWidthSample() {
            setTitle("Animasi Ukuran");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            // membaut button
            button = new JButton("Jalankan Animasi");
            // menambahkan action
            button.addActionListener(this);
            // menambahkan button
            getContentPane().setLayout(new FlowLayout());
            getContentPane().add(button);
            // membuat fx menjadi SizeAllFx
            fx = new SizeWidthFx(800);
            fx.setComponent(this);
            // mengubah ukuran awal form
            setSize(400, 400);
            // menjadikan form ditengah layar
            setLocationRelativeTo(null);
        }
    
        public void actionPerformed(ActionEvent e) {
            fx.runFx();
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            SwingUtilities.invokeLater(new Runnable() {
    
                public void run() {
                    new SizeWidthSample().setVisible(true);
                }
            });
        }
    }
    

tapi yang gak mo pusing copy-paste bisa downlaod seluruh contoh project ini di :

enjoy :evil:

6 Tanggapan

Subscribe to comments with RSS.

  1. Martinus Ady H said, on 18 November 2008 at 21:22

    Wah ampuh ^^) jarang-jarang neh blogger kek mas Eko :) mau share hasil oprekannya di blog :)

    Jadi bikin semangat nulis lagi :D

    Keep the spirit mas :)

  2. echo said, on 18 November 2008 at 21:40

    sip

    KEEP THE SPIRIT!!!
    :evil:

  3. xhijack said, on 4 Desember 2008 at 09:36

    mas eko ajarin dong bikin komponen sendiri

  4. echo said, on 4 Desember 2008 at 12:31

    lha perasaan gak perlu diajarin juga pasti bisa :D
    kadang juga kita tanpa sadar suka bikin komponen sendiri kan?
    heheh :D

  5. anjar said, on 6 Januari 2009 at 12:25

    mau buat TA pake java neh mas…
    tapi kira 2 bikin aplikasi apa ya?
    ada saran?
    masih new bie juga sih…
    pgnya sambil menyelam minum teh botol sosro..
    sambil ngerain TA skalian belajar java..
    thx

  6. coolboy said, on 10 Juli 2009 at 09:21

    bro,,tuch ko eecchhoo frame work ga jalan yach ,,,udah aku masukin,,trus masi eror di
    import org.eecchhoo.fx.Fx;
    import org.eecchhoo.fx.effect.angle.AngleDynamicHorizontalFx;

    mohon bantuannnya


Tinggalkan Balasan