Skip navigation links 
 
oracle.ide.controls
Class LayoutAnimator
java.lang.Object
  
oracle.ide.controls.LayoutAnimator
- 
public class LayoutAnimator
 
- extends java.lang.Object
 
The LayoutAnimator makes it very easy to animate the transition of components from one position to another.
- Create a LayoutAnimator based on the parent container.
 
- Move, show, hide components.
 
- Call 
animate(int, long, int, double, double, java.beans.PropertyChangeListener)() 
For example:
  public static void main(String[] args)
  {
    final JFrame frame = new JFrame();
    final Container contentPane = frame.getContentPane();
    for (String s : new String[]{BorderLayout.NORTH, BorderLayout.WEST, BorderLayout.EAST, BorderLayout.SOUTH})
    {
      final JButton button = new JButton(s);
      button.addActionListener(new ActionListener()
      {
        public void actionPerformed(ActionEvent e)
        {
          final LayoutAnimator layoutAnimator = new LayoutAnimator(contentPane);
          final Component[] components = contentPane.getComponents();
          for (int i = 0; i < components.length; i++)
          {
            final Component component = components[i];
            component.setVisible(true);
          }
          final JButton button = (JButton) e.getSource();
          button.setVisible(false);
          layoutAnimator.animate(30, 300, 10, .6F, .14F, null);
        }
      });
      contentPane.add(button, s);
    }
    final JLabel label = new JLabel("Press a button...");
    label.setOpaque(true);
    label.setHorizontalAlignment(JLabel.CENTER);
    contentPane.add(label);
    frame.setBounds(100, 100, 300, 300);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
  }
 
  
 
| Method Summary | 
 void | 
animate(int stepTime, long maxTime, int steps, double center, double sigma, java.beans.PropertyChangeListener propertyChangeListener) 
            | 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
 
LayoutAnimator
public LayoutAnimator(java.awt.Container container)
animate
public void animate(int stepTime,
                    long maxTime,
                    int steps,
                    double center,
                    double sigma,
                    java.beans.PropertyChangeListener propertyChangeListener)
Skip navigation links 
 
Copyright © 1997, 2014, Oracle. All rights reserved.