Animation Panel

I'm presently working with the trial version of CS5 while my work sorts out my new laptop and licence.
One thing, hopefully simple, that is confusing me is that I can't find the animation panel. I would like to be able to apply motion presets while changing the properties of the preset. E.g. have a bounce over a longer time, with a shorter vertical drop, etc. Help files say to use the animation panel, Window > Interactive > Animation.
But I can't find this. If I look in my Windows menu, I can't find a submenu called "Interactive". How can I find this panel?

Thanks. I see what I've done. It does seem a bit confusing that the InDesign help comes up inside Flash though.
But, I've been using the Motion Presets panel. The problem I have is that I can't scale the motion presets for total "size" of the animation or length (in time) of the animation. This means that if I have a small stage size, most motion presets will animate my symbol right off the screen. Is there an easy way to adjust the range (x, y) or time of the animations in the motion presets?

Similar Messages

  • Newbie having trouble creating a Slideshow with the Animation Panel.

    I know it's a much more complicated/advanced way to create a slideshow. But, I know it can be done.
    I will explain exactly what I do, the steps that I take. In my own newbie opinion, I think I'm just missing a step somewhere. Maybe I'm missing two or three steps. Hopefully somebody will be able to help me.
    Thank you in advance, if you do help.
    1.I open the program Adobe Bridge
    2. Then I select all images in a folder, then I utilize the review mode & deselect the photos I do not want to use.
    3. Then I open the selected images into Photoshop. (If you haven't already figured it out, I have Adobe Photoshop CS5 Extended)
    4. I clicked on Windows menu >arrange >Tile. That way all of my images are right there & ready for utilization. (At this point, none of the images have been  clicked on yet.)
    5. Then I open the animation panel & create a white blank background for the first frame.
    Here is where I run into the problem. I know how to add extra frames, that's easy enough.
    I also know that when I add the extra frame, it makes a duplicate of the previous frame.
    My problem is trying to get that extra frame to reflect the next image I would like to display in this little slideshow and so on and so forth for the next, maybe 20 images.
    Then what I would like to do is randomize the transitions with things like dissolve, honeycomb, fade in & fade out. With other options if there are any.
    I would like to create a fancy slideshow is all.
    I have read all of the help manuals, all 600+ pages. This is how far I got. I even did a search in the Adobe community. Even those articles don't quite tell you how to do this. So, I probably could have done a lot more homework. But. I'm starting to get frustrated with it.
    Hopefully someone here will be able to help me with this. Thank you Obi-Wan Kenobi in advance. :-)

    Thank You Thank You Thank You JJ Mack!
    That was exactly what I was looking for & it worked perfectly. :-)
    I have one more question if you would be so kind to help me with.
    I was wondering if there was a way to add transitions, i.e. dissolve, fading in & fading out, split, reveal, random bars, vortex stuff like that.
    I was also wondering if there was a random option for this.
    If I have to add them in manually, that's fine with me. It would be really nice to be able to add some different transitions between frames.
    Once again, thank you in advance for your help.

  • Where is the animation panel in Photoshop CS6 extended?

    where is the animation panel in Photoshop CS6 extended?

    Glad that you located the Video/Animation selection.
    If all is good, then please look over this article: http://forums.adobe.com/thread/1058744?tstart=0
    Though you found the location, just after posting, as JJMack's Reply is correct, maybe mark it as such, to help others, who find your thread in a Search, just so that they will know that you got the answer, and that the correct place to look is known. That will likely help others in the future.
    Good luck, and thank you for reporting your success.
    Hunt

  • Way to use an animation panel function working with DPS

    I’m making a mobile magazine using DPS in Adobe Indesign program.
    Is there a way to use any function on animation panel?
    I want to apply fade-in & fade-out effects to the mobile magazine, and I’ve tested it several times with smart phone and Adobe Contents Viewer but it does not work.
    (I have used an animation function in different mobile magazine before.)
    and plus,
    When testing, image and text on the scroll frame are not seen because of scroll frame.
    Waiting for an answer from who are advanced in this program.

    MungukBae wrote:
    Is there a way to use any function on animation panel?
    Not without a third party solution. Check out in5. http://indesignsecrets.com/in5-include-indesign-generated-animation-dps-articles.php
    When testing, image and text on the scroll frame are not seen because of scroll frame.
    That makes no sense to me. Can you expand on it?

  • Hints image on the animation panel does not change.

    Help I have several animation panels when the program initializes from the constructor. I have a separate AnimationPanel class that creates each panel for display. The initial ?hello ? welcome panel (from the constructor) animates on the main panel when the program begins.
    The problem is I want to have different animation panels (that are stored ) to animate and replace the main panel animation at a push of a button. While, the various panels can animate if called from the constructor, they do not animate when called from a button.
    The buttons I created to switch the main animated panel with a different one seems to work to the extent that it gets the correct music, but the image on the animation panel does not change.
    I know this is a more in depth of a question but might you be able to give me a point in the right direction?
    Here is the code from the constructor that works fine in the constructor to start the main animation.
    public PingPong()
    // null layout because it has a main panel where this display panel is placed
    super(null);
    //panels are created
    instantiatePanels();
    //panels are added to the main content pane
    placePanelsOnView();
    startAnimation();
    initializeAudio();

    The problem is that I now start it with no animation to begin with and just an empty panel, but still when I try to add an animation from the button and it will not start. The contentPane is in a different class that places the buttons and the view together.
    Here is the code that the button calls back with a getNextPanel() :
    AnimatedPanel expertPingPongPlayerPanel
              = new AnimatedPanel( );
    add(expertPingPongPlayerPanel );
         expertPingPongPlayerPanel.animate();
              expertPingPongPlayerPanel.setVisible(true);
              startAnimation();

  • Animation Panel in CS6

    Where is the Animation Panel in CS6?  (I currently have the trial version, which is Extended.)  It's not under the Window menu.

    I belive you use the timeline to create animation.  Here is a link to tutorial.  http://psd.tutsplus.com/tutorials/tools-tips/create-animated-gif-from-video/

  • Animation panel in another class

    hi all.
    how can i play a smaller animation jpanel on a different class in a larger static jpanel/jframe?
    the one that i did, did not animate.but it changes to its next frame each time i minimized/maximized the window.
    how do i deal with that?
    help...
    thanks

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Animation implements Runnable
        AnimationPanel animationPanel;
        Thread animator;
        boolean animate;
        public Animation(AnimationPanel ap)
            animationPanel = ap;
            animate = false;
        public void run()
            while(animate)
                try
                    Thread.sleep(40);
                catch(InterruptedException ie)
                    System.err.println("interrupt: " + ie.getMessage());
                    animate = false;
                animationPanel.moveBall();
        private void start()
            if(!animate)
                animate = true;
                animator = new Thread(this);
                animator.setPriority(Thread.NORM_PRIORITY);
                animator.start();
        private void stop()
            animate = false;
            animator = null;
        public static void main(String[] args)
            AnimationPanel animationPanel = new AnimationPanel();
            Animation test = new Animation(animationPanel);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(test.getNorthPanel(), "North");
            f.getContentPane().add(animationPanel);
            f.getContentPane().add(test.getSouthPanel(), "South");
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
        private JPanel getNorthPanel()
            final JRadioButton
                x = new JRadioButton("dx", true),
                y = new JRadioButton("dy");
            ButtonGroup group = new ButtonGroup();
            group.add(x);
            group.add(y);
            final JSlider slider = new JSlider(JSlider.HORIZONTAL, 1, 3, 2);
            slider.setPaintTicks(true);
            slider.setMajorTickSpacing(1);
            slider.setPaintLabels(true);
            slider.addChangeListener(new ChangeListener()
                public void stateChanged(ChangeEvent e)
                    int value = slider.getValue();
                    if(x.isSelected())
                        animationPanel.dx = value;
                    else
                        animationPanel.dy = value;
            JPanel panel = new JPanel();
            panel.setBorder(BorderFactory.createLoweredBevelBorder());
            panel.add(slider);
            panel.add(x);
            panel.add(y);
            return panel;
        private JPanel getSouthPanel()
            final JButton
                start = new JButton("start"),
                stop  = new JButton("stop");
            ActionListener l = new ActionListener()
                public void actionPerformed(ActionEvent e)
                    JButton button = (JButton)e.getSource();
                    if(button == start)
                        start();
                    if(button == stop)
                        stop();
            start.addActionListener(l);
            stop.addActionListener(l);
            JPanel panel = new JPanel();
            panel.setBorder(BorderFactory.createLoweredBevelBorder());
            panel.add(start);
            panel.add(stop);
            return panel;
    class AnimationPanel extends JPanel
        Ellipse2D ball;
        int dx, dy;
        final int DIAM = 16;
        public AnimationPanel()
            ball = new Ellipse2D.Double(50, 50, DIAM, DIAM);
            dx = 2;
            dy = 1;
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setPaint(Color.red.darker());
            g2.fill(ball);
        public void moveBall()
            checkBoundries();
            double x = ball.getX() + dx;
            double y = ball.getY() + dy;
            ball.setFrameFromDiagonal(x, y, x+DIAM, y+DIAM);
            repaint();
        private void checkBoundries()
            if(ball.getX() + dx < 0 || ball.getX() + DIAM + dx > getWidth())
                dx *= -1;
            if(ball.getY() + dy < 0 || ball.getY() + DIAM + dy > getHeight())
                dy *= -1;
    }

  • Change of animation panel / controls / management

    Animation interface and controls HAVE to be changed. It has to be more WYSIWYG: dragging start-end positions etc instead of guessing locations and line-command interface.

    Ugh. . .
    Forum seems to be losing my attachment.
    Basic principle:
    Read from Spreadsheet.
    For loop with a shift register for time point, initialized to zero.
    Inside of the for loop, a time delay for the difference in the current value from the spreadsheet from the last timepoint in the shift register.
    Index array to update shift register with new timepoint and update the indicators.
    Note, I used the dirty trick of a single frame flat sequence with an error cluster wired through it to enforce execution order of the updates.

  • Slide-out animated panel/toolbar/component

    Hello,
    I want to put a toolbar at the top of a panel. Normally it will be hidden, but when the user moves the mouse to the top of the panel, I want it to 'slide' down.
    Something similar to the Windows task bar which appears/hides itself when the mouse is present/absent.
    What would be helpful would be some suggestions on how to make it appear to 'slide in/out' of the container.
    For example, which methods to override? paintComponent() ?
    Thanks,
    Ted

    doubtful this is an ideal solution, but it might start you off
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    class Testing extends JFrame
      public Testing()
        setLocation(400,100);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        String colNames[] = {"Name", "Age"};
        Object[][] data = {{"joe","21"},{"fred","31"},{"mary","22"}};
        DefaultTableModel dtm = new DefaultTableModel(data,colNames);
        final JTable table = new JTable(dtm);
        JScrollPane sp = new JScrollPane(table);
        sp.setPreferredSize(new Dimension(300,100));
        getContentPane().add(sp);
        final JMenuBar menuBar = new JMenuBar();
        JMenu menu = new JMenu("File");
        JMenuItem open = new JMenuItem("Open");
        JMenuItem print = new JMenuItem("Print");
        JMenuItem exit = new JMenuItem("Exit");
        menu.add(open);
        menu.add(print);
        menu.add(exit);
        menuBar.add(menu);
        setJMenuBar(menuBar);
        pack();
        menuBar.setVisible(false);
        menuBar.addMouseListener(new MouseAdapter(){
          public void mouseExited(MouseEvent me){
            menuBar.setVisible(false);}});
        table.addMouseListener(new MouseAdapter(){
          public void mouseExited(MouseEvent me){
            if(me.getY() < 0) menuBar.setVisible(true);}});
      public static void main (String[] args){new Testing().setVisible(true);}
    }

  • Multithreaded Pacman: only last animated panel added to JFrame is displaye

    Hello,
    I am making a multithreaded pacman game. Pacman and each of the ghosts run in a separate thread.
    However, only the last item (ie. pacman or one of the ghosts) added to the JFrame is displaying in the maze. (pacman and each of the ghosts are subclasses of JPanel). For example, if I do:
    add(pacman);
    add(orangeGhost);
    add(redGhost);
    only the red ghost animation will appear on the maze(which is also a subclass of JPanel).
    I have tried adding the ghosts to pacman and then adding pacman i.e. pacman.add(redGhost); add(pacman); but this still doesn't work - only pacman is showing in the maze.
    Each thread runs fine on its own, but only the last one added is displaying.
    Any help is much appreciated.

    Hi,
    JFrame uses the BoderLayout layout manager, and when you add a JPanel after the other inside your JFrame they will get put one on top of other. None of the layout manager let you overlap components with transparency as far as I know. Also your JPanels are not transparent but opaque.
    I think what you need is to "paint" your game on a JPanel o canvas, take a look at this tutorial:
    http://javaboutique.internet.com/tutorials/Java_Game_Programming/
    Keep asking around, people with more experience can help you on this forum.
    Regards,

  • Animated .gif not moving

    I've been intrigued by the new animated "postcards" or cinemagraphs (for example, see http://fromme-toyou.tumblr.com/tagged/gif). I found a great tutorial about how to do this using Photoshop Extended and the animation panel. I created my own, and then followed the instructions for saving the file:
    1. "Save for Web and Devices"
    2. make sure to save as GIF, looped "forever"
    When I previewed the gif (from the "save for web and devices" dialog box), it worked great.
    But when I save the gif, it doesn't move. It is just one frame of the animation, as a static photo. When I click the file, I get a "Preview" that shows all the frames, but I can't ever get it to move.
    Is there a step I'm missing? Or is there some operating system setting I need to change? I've never created an animated gif before, but I can see other people's animated gifs in my email. (I'm attaching my gif in case you can figure it out from that.)
    OKAY...I looked at the attachment, and it moves (my dog's eyes). This is the only time it has worked. I've tried to email it, post it on Tumblr, open it in my browser, but it never worked. Now, I post it here, and--at least as I look at the attachment--it works here. How can I get it to move when I post it online or try to send it via email?
    I'm running Mac OSX 10.6, Photoshop CS 5.1.
    Thank you!
    Carol

    Some email clients disable animated GIFs.
    Web sites like Tumblr that have image upload functions may further process your file during upload by removing its animated features. You could control this by hosting images on your own web site.
    In general, animated GIF files are not ideal for emails because of their large size. GIF is an inefficient format for photorealistic animation/video.

  • Timer Class not accurate and slows down my animation!?

    Does anyknow how why my timer object is not accurate and why it slows down my animation that is also present on my GUI at the same time?
    I have a timer in the form of 0.00 the left of the decimal point should represent a second but it doesnt, run my code and see for yourselves. below is my code if anyone can fix these 2 problems i will be very thankfull:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.Shape;
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.event.*;
    import javax.swing.Timer;
    import java.sql.*;
    import java.text.*;
    public class RT extends JFrame implements MouseMotionListener
        //declares a number of swing componets to be used for the JFrame
        private JTextArea infoJTextArea;
        private JPanel showJPanel, startJPanel, helpJPanel, resultsJPanel;
        private JLabel de4JLabel, de3JLabel, mainTitleJLabel, nameJLabel, ageJLabel,
                       deJLabel, de1JLabel, de2JLabel, timeJLabel,nameResultJLabel,
                       ageResultJLabel, timeResultsJLabel, ratingJLabel, coJLabel, shJLabel;
        private JTextField nameJTextField, ageJTextField,nameResultJTextField,
                       ageResultsJTextField, timeResultsJTextField, ratingJTextField;
        private JButton exitJButton, showJButton, loginJButton, startTestJButton,
                        tempObjectJButton;
        private JScrollPane scroll;
    public JComboBox colourJComboBox, sizeJComboBox, shapeJComboBox, speedJComboBox;
    private static Connection dbcon;
    int temp=0;
    private String[] col = { "Red", "Blue", "Green","Yellow","Orange","Black"};
    private String[] shapeA = { "Normal Rectangle", "Normal Circle", "Normal Oval","BIG Rectangle", "BIG Circle","BIG Oval","small rectangle","small circle", "small oval"};
    private String[] speed = { "Fast", "Normal", "Slow"};
    public int checking;
    static int flag, flagshape, flagspeed;
        // creates and sets up a number of varibles to be used by the class
        public long timeLimit = 0;
        DecimalFormat timeDec = new DecimalFormat (":00");
        public int age;
        public String name, shapeChoice="Normal Rectangle(Never selected anything)", colourChoice="Black(Never selected anything)";
        private Timer TimeNow;
        private JTextField timerJTextField;
        ShapeMovingPanel testJPanel;
        Random seed;
        Shape shape;
        Shape[] shapes = {new Rectangle2D.Double(50, 30, 75, 25),new Ellipse2D.Double(175, 125, 50, 50),new Ellipse2D.Double(90, 100, 75, 35),new Rectangle2D.Double(50, 30, 175, 125),new Ellipse2D.Double(175, 125, 125, 125),new Ellipse2D.Double(90, 100, 175, 135),new Rectangle2D.Double(50, 30, 55, 15),new Ellipse2D.Double(175, 125, 20,20),new Ellipse2D.Double(90, 100, 55, 15)};
    //50, 30, 75, 25 change starting point here****************************************
        public RT()            // constructor method
            seed = new Random();
            shape = shapes[0];
            //sets up the Timer
            TimeNow = new Timer((1), new TimerListener());//++++++++++++++++++++++++++timer -17
            createUserInterface();          // method that creates the user interface     
        private void createUserInterface()
            new Thread(new Runnable()
                public void run()
                    String results = "";
                    int count = 0;
                    boolean journeyOn = true;
                    while(journeyOn && count < 3)
                        try
                            Thread.sleep(1000);
                        catch(InterruptedException ie)
                            System.err.println("show interrupt: " + ie.getMessage());
                            journeyOn = false;
                        results += count++ + ", ";
                    try {
                             Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                             dbcon = DriverManager.getConnection("jdbc:odbc:CMT3991", "", ""); // Access/ODBC
                          //connection ash used to connect to the user table in access
                           } catch(Exception eee)
                           eee.printStackTrace();  //exception if error occurs during the driver connection
                             System.out.println("* UserDA CONNECTED *");
            }).start();
            Container contentPane = getContentPane();
            contentPane.setLayout( null );
            // set up infoJTextField
            infoJTextArea = new JTextArea();
            infoJTextArea.setBounds( 20, 420, 550, 170  );
            infoJTextArea.setEditable( false);
            infoJTextArea.setText("\n    Welcome to the reaction testing program, this " +
                            "program is designed to test your reactions in a  \n"+
                            "    number of different situations.\n"+"\n    Please " +
                            "enter your name and age, or select show previous results.");
            contentPane.add( infoJTextArea );
            scroll = new JScrollPane(infoJTextArea);
            scroll.setBounds(  20, 420, 550, 170 );
            contentPane.add( scroll );
                  startJPanel = new JPanel();
            startJPanel.setBounds( 16,16, 560, 375 );
            startJPanel.setBorder(
                    new TitledBorder( "WELCOME - PLEASE ENTER YOUR NAME AND AGE:" ) );
            startJPanel.setLayout( null );
            contentPane.add( startJPanel );
            //sets up a JPanel
            mainTitleJLabel = new JLabel();
            mainTitleJLabel.setIcon( new ImageIcon( "title.png" ) );
            mainTitleJLabel.setBounds( 30, 10, 520, 170 );
            mainTitleJLabel.setHorizontalAlignment( JLabel.CENTER );
            startJPanel.add( mainTitleJLabel );
            //creates a newJLabel
            nameJLabel= new JLabel();
            nameJLabel.setBounds( 52, 200, 70, 35 );
            nameJLabel.setText("Name:");
            startJPanel.add( nameJLabel);
            //creates a new JTextField
            nameJTextField = new JTextField();
            nameJTextField.setBounds( 130, 200, 300, 24 );
            startJPanel.add( nameJTextField );
            //creates a newJLabel
            ageJLabel = new JLabel();
            ageJLabel.setBounds( 52, 245, 100, 35 );
            ageJLabel.setText("Age:");
            startJPanel.add( ageJLabel );
            //creates a new JTextField
            ageJTextField = new JTextField();
            ageJTextField.setBounds( 130, 245, 300, 24 );
            startJPanel.add( ageJTextField );
            //creates a JButton
            loginJButton = new JButton();
            loginJButton.setBounds( 440, 200, 90, 24 );
            loginJButton.setText( "Login" );
            loginJButton.setBackground( Color.YELLOW );
            startJPanel.add( loginJButton );
            loginJButton.setEnabled(true);
    //        loginJButton.setVisible(true);
            loginJButton.addActionListener(
                new ActionListener()    // adds an action listener,anonymous inner class
                    // event handler called when search is pressed
                    public void actionPerformed( ActionEvent event )
                        // not necessary to pass events to these methods...
                        Login();  // calls the Login method                       
            //creates a JButton
            showJButton = new JButton();
            showJButton.setBounds( 200, 320, 180, 24 );
            showJButton.setText( "Show previous results" );
            showJButton.setBackground( Color.YELLOW );
            startJPanel.add( showJButton );
            showJButton.setEnabled(true);
    //        showJButton.setVisible(true);
            showJButton.addActionListener(
                new ActionListener()    // adds an action listener,anonymous inner class
                    // event handler called when search is pressed
                    public void actionPerformed( ActionEvent event )
                        showData();   // calls the showData method                       
            //sets up a JPanel
            showJPanel = new JPanel();
            showJPanel.setBounds( 16,16, 560, 375 );
            showJPanel.setBorder(new TitledBorder( "PREVIOUS RESULTS:" ) );
            showJPanel.setLayout( null );
            contentPane.add( showJPanel );
            //sets up a JPanel
            helpJPanel = new JPanel();
            helpJPanel.setBounds( 16,16, 560, 375 );
            helpJPanel.setBorder(
            new TitledBorder( "CHOOSE A NUMBER OF OPTIONS AND GET READY:" ) );
            helpJPanel.setLayout( null );
            helpJPanel.setVisible(false);
            contentPane.add( helpJPanel );
            //creates a newJLabel
            deJLabel= new JLabel();
            deJLabel.setBounds( 23, 390, 530, 35 );
            deJLabel.setText("Details:");
            contentPane.add( deJLabel);
            //creates a newJLabel
            coJLabel= new JLabel();
            coJLabel.setBounds( 70, 40, 530, 35 );
            coJLabel.setText("Choose a colour:");
            helpJPanel.add( coJLabel);
            //creates a newJLabel
            de1JLabel= new JLabel();
            de1JLabel.setBounds( 25, 100, 530, 35 );
            de1JLabel.setText("You are about to start the reaction test, when you " +
                              "press the start button it will begin.");
            helpJPanel.add( de1JLabel);
            //creates a newJLabel
            de1JLabel= new JLabel();
            de1JLabel.setBounds(160, 145, 530, 35 );
            de1JLabel.setText("Simply catch the moving item and click.");
            helpJPanel.add( de1JLabel);
            colourJComboBox = new JComboBox( col );
               colourJComboBox.setBounds( 70, 70, 135, 21 );
               colourJComboBox.setMaximumRowCount( 3 );
               helpJPanel.add( colourJComboBox );
              colourJComboBox.addActionListener(
                new ActionListener() // adds an action listener,anonymous inner class
                    // event handler called when search is pressed
                    public void actionPerformed( ActionEvent event )
                         colourChoice="Black";
                         int x = colourJComboBox.getSelectedIndex();
                        if( x  == 0)
                             flag = 1;
                             colourChoice="Red";
                        else if(x  == 1)
                             flag = 2;
                             colourChoice="Blue";
                        else if(x  == 2)
                             flag = 3;
                                colourChoice="Green";
                         else if(x  == 3)
                             flag = 4;
                                colourChoice="Yellow";
                         else if(x  == 4)
                             flag = 5;
                                colourChoice="Orange";
                           else if(x  == 5)
                             flag = 6;
                                colourChoice="Black";
            shJLabel= new JLabel();
            shJLabel.setBounds( 340, 40, 530, 35 );
            shJLabel.setText("Choose a shape and size:");
            helpJPanel.add( shJLabel);
            shapeJComboBox = new JComboBox( shapeA );
               shapeJComboBox.setBounds( 340, 70, 135, 21 );
               shapeJComboBox.setMaximumRowCount( 3 );
               helpJPanel.add( shapeJComboBox );
              shapeJComboBox.addActionListener(
                new ActionListener() // adds an action listener,anonymous inner class
                    // event handler called when search is pressed
                    public void actionPerformed( ActionEvent event )
                          int xshape = shapeJComboBox.getSelectedIndex();
                        //shapeChoice="Normal Rectangle";
                        if( xshape  == 0)
                        {     flagshape = 1;
                             shapeChoice="Normal Rectangle";
                        else if(xshape  == 1)
                        {     flagshape = 2;
                             shapeChoice="Normal Circle";
                        else if(xshape  == 2)//**********here
                        {     flagshape = 3;
                             shapeChoice="Normal Oval";
                        else if(xshape  == 3)
                        {     flagshape = 4;
                             shapeChoice="BIG Rectangle";
                        else if(xshape  == 4)
                       {      flagshape = 5;
                             shapeChoice="BIG Circle";
                        else if(xshape  == 5)
                     {        flagshape = 6;
                             shapeChoice="BIG Oval";
                        else if(xshape  == 6)
                             flagshape = 7;
                             shapeChoice="small rectangle";
                        else if(xshape  == 7)
                     {        flagshape = 8;
                             shapeChoice="small circle";
                        else if(xshape  == 8)
                     {        flagshape = 9;
                             shapeChoice="small oval";
          /*  speedJComboBox = new JComboBox( speed );
               speedJComboBox.setBounds( 10, 150, 135, 21 );
               speedJComboBox.setMaximumRowCount( 3 );
               helpJPanel.add( speedJComboBox );
              speedJComboBox.addActionListener(
                new ActionListener() // adds an action listener,anonymous inner class
                    // event handler called when search is pressed
                    public void actionPerformed( ActionEvent event )
                          int xspeed = speedJComboBox.getSelectedIndex();
                        if( xspeed  == 0)
                             flagspeed = 1;
                             else if(xspeed  == 1)
                             flagspeed = 2;
                             else
                             flagspeed = 3;
                        System.out.println(flagspeed);     
            //creates a newJLabel
            de2JLabel= new JLabel();
            de2JLabel.setBounds( 20, 380, 70, 35 );
            de2JLabel.setText("Details:");
            helpJPanel.add( de2JLabel);
            //creates a JButton
            startTestJButton = new JButton();
            startTestJButton.setBounds( 185, 205, 180, 60 );
            startTestJButton.setText( "START" );
            startTestJButton.setBackground( Color.YELLOW );
            helpJPanel.add( startTestJButton );
            startTestJButton.setEnabled(true);
    //        startTestJButton.setVisible(true);
            startTestJButton.addActionListener(
                new ActionListener() // adds an action listener,anonymous inner class
                    // event handler called when search is pressed
                    public void actionPerformed( ActionEvent event )
                        startTest();
            //sets up an animation panel
            testJPanel = new ShapeMovingPanel(this);
            testJPanel.setBounds( 16,16, 560, 375 );
            testJPanel.setBorder(new TitledBorder("Click the moving object:"));
            testJPanel.setLayout( null );
            testJPanel.setVisible(false);
            contentPane.add( testJPanel );
            testJPanel.addMouseMotionListener(this);
            //creates a newJLabel
            timeJLabel = new JLabel();
            timeJLabel.setBounds( 440, 330, 100, 35 );
            timeJLabel.setText("Time:");
            testJPanel.add( timeJLabel );
            //creates a new JTextField
            timerJTextField = new JTextField();
            timerJTextField.setBounds( 480, 335, 60, 24 );
            timerJTextField.setText(String.valueOf(timeLimit));
            timerJTextField.setHorizontalAlignment(JTextField.CENTER );
            timerJTextField.setEditable(false);
            timerJTextField.setBackground( Color.YELLOW );
            testJPanel.add( timerJTextField );
            resultsJPanel = new JPanel();
            resultsJPanel.setBounds( 16,16, 560, 375 );
            resultsJPanel.setBorder(new TitledBorder("HERE ARE YOUR RESULTS:"));
            resultsJPanel.setLayout( null );
            resultsJPanel.setVisible(false);
            contentPane.add( resultsJPanel );
            de3JLabel= new JLabel();
            de3JLabel.setBounds(20, 200, 530, 35 );
            de3JLabel.setText("Below is also the movements you made with your mouse, " +
                              "you may exit the program now.");
            resultsJPanel.add( de3JLabel);
            de4JLabel= new JLabel();
            de4JLabel.setBounds(135, 245, 530, 35 );
            de4JLabel.setText("Thank you for trying the Reaction Testing program");
            resultsJPanel.add( de4JLabel);
            //creates a newJLabel
            nameResultJLabel= new JLabel();
            nameResultJLabel.setBounds( 62, 55, 50, 35 );
            nameResultJLabel.setText("Name:");
            resultsJPanel.add( nameResultJLabel);
            //creates a new JTextField
            nameResultJTextField = new JTextField();
            nameResultJTextField.setBounds( 140, 55, 300, 24 );
            resultsJPanel.add( nameResultJTextField );
            nameResultJTextField.setEditable(false);
            //creates a newJLabel
            ageResultJLabel = new JLabel();
            ageResultJLabel.setBounds( 62, 90, 100, 35 );
            ageResultJLabel.setText("Age:");
            resultsJPanel.add( ageResultJLabel );
            //creates a new JTextField
            ageResultsJTextField = new JTextField();
            ageResultsJTextField.setBounds( 140, 90, 300, 24 );
            resultsJPanel.add( ageResultsJTextField );
            ageResultsJTextField.setEditable(false);
            //creates a newJLabel
            timeResultsJLabel = new JLabel();
            timeResultsJLabel.setBounds( 62, 125, 100, 35 );
            timeResultsJLabel.setText("Time taken:");
            resultsJPanel.add( timeResultsJLabel );
            //creates a new JTextField
            timeResultsJTextField = new JTextField();
            timeResultsJTextField.setBounds( 140, 125, 300, 24 );
            resultsJPanel.add( timeResultsJTextField );
            timeResultsJTextField.setEditable(false);
            //creates a newJLabel
            ratingJLabel = new JLabel();
            ratingJLabel.setBounds( 62, 160, 100, 35 );
            ratingJLabel.setText("Your Rating:");
            resultsJPanel.add( ratingJLabel );
            ratingJTextField = new JTextField();
            ratingJTextField.setBounds( 140, 160, 300, 24 );
            resultsJPanel.add( ratingJTextField );
            ratingJTextField.setEditable(false);
            //creates a JButton
            exitJButton = new JButton();
            exitJButton.setBounds( 235, 310, 90, 24 );
            exitJButton.setText( "Exit" );
            exitJButton.setBackground( Color.WHITE );
            resultsJPanel.add( exitJButton );
            exitJButton.setEnabled(true);
            exitJButton.addActionListener(
                new ActionListener() // adds an action listener,anonymous inner class
                    // event handler called when exitJButton is pressed
                    public void actionPerformed( ActionEvent event )
                        System.exit(0); //closes the programme
            }); // end anonymous inner class
            addWindowListener(new WindowAdapter()
                public void windowClosing(WindowEvent e)
                    System.exit(0);
            // set properties of application's window
            setTitle( "Reaction Tester - CMT3991" ); // set JFrame's title bar string
            //setSize( 1280,995 );    // set width and height of JFrame
            setSize( 608, 650 );         // set width and height of JFrame
            setVisible( true );       // display JFrame on screen
        //** set up of method main */
        public static void main( String[] args )
            RT application = new RT();
            application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        } // end method main
         * action listener for TimeNow Timer
        private class TimerListener implements ActionListener
            public void actionPerformed(ActionEvent event)
                timeLimit ++;          
                if (timeLimit==100)
                     temp++;
                     timeLimit=0;
                timerJTextField.setText(String.valueOf(temp +""+timeDec.format(timeLimit)));
        private void Login()
            try
                name = nameJTextField.getText();
                age = Integer.parseInt(ageJTextField.getText());
                startJPanel.setVisible(false);
                showJPanel.setVisible(false);
                helpJPanel.setVisible(true);
                infoJTextArea.setText("\n    Welcome "+name+" you will soon know how " +
                                      "fast your reactions are.");
            catch (NumberFormatException exception)
                JOptionPane.showMessageDialog(this,
                        "There is either a blank field or a number hasn't been entered",
                        "Input Type error", JOptionPane.ERROR_MESSAGE);
                //shows this is something has been entered wrong
        private void startTest()
            helpJPanel.setVisible(false);
          //  System.out.println(""+ seed.nextInt(shapes.length));
            //shape = shapes[seed.nextInt(shapes.length)];//****************************
            if (flagshape==1)
                 shape = shapes[0];// changed colour here***************************
            else if (flagshape==2)
                 shape = shapes[1];// changed colour here***************************
            else if (flagshape==3)
                 shape = shapes[2];// changed colour here***************************
           else if (flagshape==4)
                 shape = shapes[3];// changed colour here***************************
             else if (flagshape==5)
                 shape = shapes[4];// changed colour here***************************
            else if (flagshape==6)
                 shape = shapes[5];// changed colour here***************************
            else if (flagshape==7)
                 shape = shapes[6];// changed colour here***************************
            else if (flagshape==8)
                 shape = shapes[7];// changed colour here***************************
            else if (flagshape==9)
                 shape = shapes[8];// changed colour here***************************
           // shape = shapes[8];
            System.out.println(shape.toString());
            testJPanel.setShape(shape);
            testJPanel.setVisible(true);
            testJPanel.start();
            infoJTextArea.setText("");
            TimeNow.start();
         * called by animation panel after shape is clicked
        public void stop()
            TimeNow.stop();
            movingObject();
         * this will compete with your animation
         * ie, it will slow it down or make it appear jerky
        public void mouseMoved(MouseEvent e)
            saySomething("\n    Mouse moved", e);
        public void mouseDragged(MouseEvent e)
            saySomething("\n    Mouse dragged", e);
        void saySomething(String eventDescription, MouseEvent e)
            infoJTextArea.append(eventDescription
                         + " (" + e.getX() + "," + e.getY() + ")");
            infoJTextArea.setCaretPosition(infoJTextArea.getDocument().getLength());
        private void movingObject()
            TimeNow.stop();
            //timeLimit;
            testJPanel.setVisible(false);
            resultsJPanel.setVisible(true);
            nameResultJTextField.setText(name);
            ageResultsJTextField.setText(String.valueOf(age)+" years old");
    System.out.println("shape used: "+shapeChoice);
            String mouse = infoJTextArea.getText();
            String tick = timerJTextField.getText();
            timeResultsJTextField.setText(tick);
            try
                // create a file called welch.txt
                final FileWriter outputFile = new FileWriter("Backup_of_"+name+"s_results.txt", true);
                final BufferedWriter outputBuffer = new BufferedWriter(outputFile);
                // converts data to a formatted string
                final PrintWriter printstream = new PrintWriter(outputBuffer);
                printstream.println("THIS IS A BACKUP");
                printstream.println("The person's name is: "+name);
                printstream.println("There age is: "+age);
                printstream.println("Time taken: "+tick+" seconds");
                printstream.println("The Shape and size was: "+shapeChoice);
                printstream.println("It's colour was: "+colourChoice);
                printstream.println("The mouse moved as follows: "+mouse);
                //states what needs to be printed to the new file
                printstream.close(); // closes teh printstream
            catch(IOException eio)
                //catchs the IO exception
            if(temp<5.00)
                ratingJTextField.setText("Thierry Henry");     
            else if(timeLimit<=10)
                ratingJTextField.setText("Average");     
            else if(timeLimit<=15)
                ratingJTextField.setText("You gotta be fat or something");     
            else if(timeLimit<=20)
                ratingJTextField.setText("See a doctor");
            else if(timeLimit>20)
                ratingJTextField.setText("DO YOU KNOW WHAT YOU DOING!?");
            String rate=ratingJTextField.getText();
            try
                   Statement st = dbcon.createStatement();
                   String cmd = "INSERT INTO users (Name, Age, Time_Taken, Rating, Mouse_Movement,Shape_and_Size, Shape_Colour) VALUES ('" + name + "' , " + age + " , '" + tick + "' , '" + rate+"','"+ mouse+"','"+ shapeChoice+"','"+ colourChoice+"');";
                //creates a SQL statement and executes it
                st.executeUpdate(cmd);
                   st.close();//close the statement
              } catch (Exception eDA)
                   eDA.printStackTrace();
        private void showData()
            // pretend this takes awhile -> 3 seconds (count)
            new Thread(new Runnable()
                public void run()
                    String results = "";
                    int count = 0;
                    boolean journeyOn = true;
                    while(journeyOn && count < 3)
                        try
                            Thread.sleep(1000);
                        catch(InterruptedException ie)
                            System.err.println("show interrupt: " + ie.getMessage());
                            journeyOn = false;
                        results += count++ + ", ";
                    infoJTextArea.setText("Here are your results:\n"+results);
                    startJPanel.setVisible(false);
                    showJPanel.setVisible(true);
            }).start();
    class ShapeMovingPanel extends JPanel implements ActionListener
        RT host;
        Timer timer;
        Shape shape, xformed;
        int x, y, dx, dy;
        public ShapeMovingPanel(RT rt)
            timer = new Timer(-20, this);     
            host = rt;
        /*    if (rt.flagspeed==1)
            timer = new Timer(-20, this);
            else if (rt.flagspeed==2)
                timer = new Timer(20, this);
            else if (rt.flagspeed==3)
            timer = new Timer(100, this);
            //change speed here******************************
            x = 0;//0
            y = 0;//0
            dx =2;//2
            dy = 3;//3
            //setBackground(Color.pink);
            addMouseListener(new ShapeTender());
        public void actionPerformed(ActionEvent e)
            int w = getWidth();
            int h = getHeight();
            if(w <= 0 || h <= 0)
                return;
            checkBoundries(w,h);
            x += dx;
            y += dy;
            repaint();
        private void checkBoundries(int w, int h)
            Rectangle r = xformed.getBounds();
            Insets insets = getInsets();
            if(r.x + dx < insets.left || r.x + r.width + dx > w - insets.right)
                dx *= -1;
            if(r.y + dy < insets.top || r.y + r.height + dy > h - insets.bottom)
                dy *= -1;
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            AffineTransform at = AffineTransform.getTranslateInstance(x, y);
            if (RT.flag==1)
            {g2.setPaint(Color.red);// changed colour here***************************
            else if (RT.flag==2)
            {g2.setPaint(Color.blue);// changed colour here***************************
            else if (RT.flag==3)
            {g2.setPaint(Color.green);// changed colour here***************************
            else if (RT.flag==4)
            {g2.setPaint(Color.yellow);// changed colour here***************************
            else if (RT.flag==5)
            {g2.setPaint(Color.orange);// changed colour here***************************
            else if (RT.flag==6)
            {g2.setPaint(Color.black);// changed colour here***************************
            xfo                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     

    I'm (being lazy and) using the older RT app posted on your last thread. I removed the
    TimeNow timer from the RT class and used System.currentTimeMillis (as you requested) to
    determine the elapsed time during the animation (see "startTest", "stop" and
    "movingObject" methods). Also changed the DecimalFormat to NumberFormat and set the
    "maximumFractionDigits" to "2" so it will truncate the fraction to two digits (more simple
    than before). Made arrangements for the ShapeMovingPanel class to update the
    "timerJTextField" during the animation (RT.updateTime method).
    The MouseMotionListener is causing the animation to appear jerky and uneven. The
    "mouseMoved" method is very busy while the mouse is moving. You might consider recording
    the "mousePressed" events instead of the "mouseMoved" events, ie, the events where the user
    is attempting to click inside the moving shape. It would allow the app to be more
    responsive and might eliminate the uneven motion of the animating shape.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.event.*;
    import javax.swing.Timer;
    public class RT extends JFrame implements MouseMotionListener
        //declares a number of swing componets to be used for the JFrame
        private JTextArea infoJTextArea;
        private JPanel showJPanel, startJPanel, helpJPanel, resultsJPanel;
        private JLabel de4JLabel, de3JLabel, mainTitleJLabel, nameJLabel, ageJLabel,
                       deJLabel, de1JLabel, de2JLabel, timeJLabel,nameResultJLabel,
                       ageResultJLabel, timeResultsJLabel, ratingJLabel;
        private JTextField nameJTextField, ageJTextField,nameResultJTextField,
                       ageResultsJTextField, timeResultsJTextField, ratingJTextField;
        private JButton exitJButton, showJButton, loginJButton, startTestJButton,
                        tempObjectJButton;
        private JScrollPane scroll;;
        // creates and sets up a number of varibles to be used by the class
        private long startTime;
        private long endTime;
        public int timeLimit = 0;
        public int age;
        public String name;
        private JTextField timerJTextField;
        ShapeMovingPanel testJPanel;
        NumberFormat timeDec;
        Random seed;
        Shape shape;
        Shape[] shapes = {
            new Rectangle2D.Double(50, 30, 75, 25),
            new Ellipse2D.Double(175, 125, 50, 50),
            new Ellipse2D.Double(90, 100, 75, 35)
        public RT()
            timeDec = NumberFormat.getInstance();
            timeDec.setMaximumFractionDigits(2);
            seed = new Random();
            shape = shapes[0];
            createUserInterface();
        private void createUserInterface()
            Container contentPane = getContentPane();
            contentPane.setLayout( null );
            // set up infoJTextField
            infoJTextArea = new JTextArea();
            infoJTextArea.setBounds( 20, 420, 550, 170  );
            infoJTextArea.setEditable( false);
            infoJTextArea.setText("\n    Welcome to the reaction testing program, this " +
                            "program is designed to test your reactions in a  \n"+
                            "    number of different situations.\n"+"\n    Please " +
                            "enter your name and age, or select show previous results.");
            contentPane.add( infoJTextArea );
            scroll = new JScrollPane(infoJTextArea);
            scroll.setBounds(  20, 420, 550, 170 );
            contentPane.add( scroll );
              startJPanel = new JPanel();
            startJPanel.setBounds( 16,16, 560, 375 );
            startJPanel.setBorder(
                    new TitledBorder( "WELCOME -PLEASE ENTER YOUR NAME AND AGE:" ) );
            startJPanel.setLayout( null );
            contentPane.add( startJPanel );
            //sets up a JPanel
            mainTitleJLabel = new JLabel();
            mainTitleJLabel.setIcon( new ImageIcon( "title.png" ) );
            mainTitleJLabel.setBounds( 30, 10, 520, 170 );
            mainTitleJLabel.setHorizontalAlignment( JLabel.CENTER );
            startJPanel.add( mainTitleJLabel );
            //creates a newJLabel
            nameJLabel= new JLabel();
            nameJLabel.setBounds( 52, 200, 70, 35 );
            nameJLabel.setText("Name:");
            startJPanel.add( nameJLabel);
            //creates a new JTextField
            nameJTextField = new JTextField();
            nameJTextField.setBounds( 130, 200, 300, 24 );
            startJPanel.add( nameJTextField );
            //creates a newJLabel
            ageJLabel = new JLabel();
            ageJLabel.setBounds( 52, 245, 100, 35 );
            ageJLabel.setText("Age:");
            startJPanel.add( ageJLabel );
            //creates a new JTextField
            ageJTextField = new JTextField();
            ageJTextField.setBounds( 130, 245, 300, 24 );
            startJPanel.add( ageJTextField );
            //creates a JButton
            loginJButton = new JButton();
            loginJButton.setBounds( 440, 200, 90, 24 );
            loginJButton.setText( "Login" );
            loginJButton.setBackground( Color.YELLOW );
            startJPanel.add( loginJButton );
            loginJButton.setEnabled(true);
            loginJButton.addActionListener(
                new ActionListener()    // adds an action listener,anonymous inner class
                    // event handler called when search is pressed
                    public void actionPerformed( ActionEvent event )
                        // not necessary to pass events to these methods...
                        Login();  // calls the Login method                       
            //creates a JButton
            showJButton = new JButton();
            showJButton.setBounds( 200, 320, 180, 24 );
            showJButton.setText( "Show previous results" );
            showJButton.setBackground( Color.YELLOW );
            startJPanel.add( showJButton );
            showJButton.setEnabled(true);
            showJButton.addActionListener(
                new ActionListener()    // adds an action listener,anonymous inner class
                    // event handler called when search is pressed
                    public void actionPerformed( ActionEvent event )
                        showData();   // calls the showData method                       
            //sets up a JPanel
            showJPanel = new JPanel();
            showJPanel.setBounds( 16,16, 560, 375 );
            showJPanel.setBorder(new TitledBorder( "PREVIOUS RESULTS:" ) );
            showJPanel.setLayout( null );
            contentPane.add( showJPanel );
            //sets up a JPanel
            helpJPanel = new JPanel();
            helpJPanel.setBounds( 16,16, 560, 375 );
            helpJPanel.setBorder(
            new TitledBorder( "HELP DETAILS:" ) );
            helpJPanel.setLayout( null );
            helpJPanel.setVisible(false);
            contentPane.add( helpJPanel );
            //creates a newJLabel
            deJLabel= new JLabel();
            deJLabel.setBounds( 23, 390, 530, 35 );
            deJLabel.setText("Details:");
            contentPane.add( deJLabel);
            //creates a newJLabel
            de1JLabel= new JLabel();
            de1JLabel.setBounds( 25, 100, 530, 35 );
            de1JLabel.setText("You are about to start the reaction test, when you " +
                              "press the start button it will begin.");
            helpJPanel.add( de1JLabel);
            //creates a newJLabel
            de1JLabel= new JLabel();
            de1JLabel.setBounds(160, 145, 530, 35 );
            de1JLabel.setText("Simply catch the moving item and click.");
            helpJPanel.add( de1JLabel);
            //creates a newJLabel
            de2JLabel= new JLabel();
            de2JLabel.setBounds( 20, 380, 70, 35 );
            de2JLabel.setText("Details:");
            helpJPanel.add( de2JLabel);
            //creates a JButton
            startTestJButton = new JButton();
            startTestJButton.setBounds( 185, 205, 180, 60 );
            startTestJButton.setText( "START" );
            startTestJButton.setBackground( Color.YELLOW );
            helpJPanel.add( startTestJButton );
            startTestJButton.setEnabled(true);
            startTestJButton.addActionListener(
                new ActionListener() // adds an action listener,anonymous inner class
                    // event handler called when search is pressed
                    public void actionPerformed( ActionEvent event )
                        startTest();
            //sets up an animation panel
            testJPanel = new ShapeMovingPanel(this);
            testJPanel.setBounds( 16,16, 560, 375 );
            testJPanel.setBorder(new TitledBorder("Click the moving object:"));
            testJPanel.setLayout( null );
            testJPanel.setVisible(false);
            contentPane.add( testJPanel );
    // this is causing the animation to appear uneven
    // you can try the app with and without this to see
    //        testJPanel.addMouseMotionListener(this);
            //creates a newJLabel
            timeJLabel = new JLabel();
            timeJLabel.setBounds( 440, 330, 100, 35 );
            timeJLabel.setText("Time:");
            testJPanel.add( timeJLabel );
            //creates a new JTextField
            timerJTextField = new JTextField();
            timerJTextField.setBounds( 480, 335, 60, 24 );
            timerJTextField.setText(String.valueOf(timeLimit));
            timerJTextField.setHorizontalAlignment(JTextField.CENTER );
            timerJTextField.setEditable(false);
            timerJTextField.setBackground( Color.YELLOW );
            testJPanel.add( timerJTextField );
            resultsJPanel = new JPanel();
            resultsJPanel.setBounds( 16,16, 560, 375 );
            resultsJPanel.setBorder(new TitledBorder("HERE ARE YOUR RESULTS:"));
            resultsJPanel.setLayout( null );
            resultsJPanel.setVisible(false);
            contentPane.add( resultsJPanel );
            de3JLabel= new JLabel();
            de3JLabel.setBounds(20, 200, 530, 35 );
            de3JLabel.setText("Below is also the movements you made with your mouse, " +
                              "you may exit the program now.");
            resultsJPanel.add( de3JLabel);
            de4JLabel= new JLabel();
            de4JLabel.setBounds(135, 245, 530, 35 );
            de4JLabel.setText("Thank you for trying the Reaction Testing program");
            resultsJPanel.add( de4JLabel);
            //creates a newJLabel
            nameResultJLabel= new JLabel();
            nameResultJLabel.setBounds( 62, 55, 50, 35 );
            nameResultJLabel.setText("Name:");
            resultsJPanel.add( nameResultJLabel);
            //creates a new JTextField
            nameResultJTextField = new JTextField();
            nameResultJTextField.setBounds( 140, 55, 300, 24 );
            resultsJPanel.add( nameResultJTextField );
            nameResultJTextField.setEditable(false);
            //creates a newJLabel
            ageResultJLabel = new JLabel();
            ageResultJLabel.setBounds( 62, 90, 100, 35 );
            ageResultJLabel.setText("Age:");
            resultsJPanel.add( ageResultJLabel );
            //creates a new JTextField
            ageResultsJTextField = new JTextField();
            ageResultsJTextField.setBounds( 140, 90, 300, 24 );
            resultsJPanel.add( ageResultsJTextField );
            ageResultsJTextField.setEditable(false);
            //creates a newJLabel
            timeResultsJLabel = new JLabel();
            timeResultsJLabel.setBounds( 62, 125, 100, 35 );
            timeResultsJLabel.setText("Time taken:");
            resultsJPanel.add( timeResultsJLabel );
            //creates a new JTextField
            timeResultsJTextField = new JTextField();
            timeResultsJTextField.setBounds( 140, 125, 300, 24 );
            resultsJPanel.add( timeResultsJTextField );
            timeResultsJTextField.setEditable(false);
            //creates a newJLabel
            ratingJLabel = new JLabel();
            ratingJLabel.setBounds( 62, 160, 100, 35 );
            ratingJLabel.setText("Your Rating:");
            resultsJPanel.add( ratingJLabel );
            ratingJTextField = new JTextField();
            ratingJTextField.setBounds( 140, 160, 300, 24 );
            resultsJPanel.add( ratingJTextField );
            ratingJTextField.setEditable(false);
            //creates a JButton
            exitJButton = new JButton();
            exitJButton.setBounds( 235, 310, 90, 24 );
            exitJButton.setText( "Exit" );
            exitJButton.setBackground( Color.WHITE );
            resultsJPanel.add( exitJButton );
            exitJButton.setEnabled(true);
            exitJButton.addActionListener(
                new ActionListener() // adds an action listener,anonymous inner class
                    // event handler called when exitJButton is pressed
                    public void actionPerformed( ActionEvent event )
                        System.exit(0); //closes the programme
            }); // end anonymous inner class
            addWindowListener(new WindowAdapter()
                public void windowClosing(WindowEvent e)
                    System.exit(0);
            // set properties of application's window
            setTitle( "Reaction Tester - CMT3991" ); // set JFrame's title bar string
            //setSize( 1280,995 );    // set width and height of JFrame
            setSize( 608, 650 );         // set width and height of JFrame
            setVisible( true );       // display JFrame on screen
        //** set up of method main */
        public static void main( String[] args )
            RT application = new RT();
            application.setDefaultCloseOperation( EXIT_ON_CLOSE );
        } // end method main
        private void Login()
            try
                name = nameJTextField.getText();
                age = Integer.parseInt(ageJTextField.getText());
                startJPanel.setVisible(false);
                showJPanel.setVisible(false);
                helpJPanel.setVisible(true);
                infoJTextArea.setText("\n    Welcome "+name+" you will soon know how " +
                                      "fast your reactions are");
            catch (NumberFormatException exception)
                JOptionPane.showMessageDialog(this,
                        "There is either a blank field or a number hasn't been entered",
                        "Input Type error", JOptionPane.ERROR_MESSAGE);
                //shows this is something has been entered wrong
        private void startTest()
            helpJPanel.setVisible(false);
            shape = shapes[seed.nextInt(shapes.length)];
            testJPanel.setShape(shape);
            testJPanel.setVisible(true);
            testJPanel.start();
            startTime = System.currentTimeMillis();
            infoJTextArea.setText("");
         * called by animation panel after shape is clicked
        public void stop()
            endTime = System.currentTimeMillis();
            movingObject();
         * called by timer actionPerformed in ShapeMovingPanel
        public void updateTime()
            long timeNow = System.currentTimeMillis();
            double elapsed = (timeNow - startTime)/1000.0;
            timerJTextField.setText(timeDec.format(elapsed));
         * this will compete with your animation
         * ie, it will slow it down or make it appear jerky
        public void mouseMoved(MouseEvent e)
            saySomething("\n    Mouse moved", e);
        public void mouseDragged(MouseEvent e)
            saySomething("\n    Mouse dragged", e);
        void saySomething(String eventDescription, MouseEvent e)
            infoJTextArea.append(eventDescription
                         + " (" + e.getX() + "," + e.getY() + ")");
            infoJTextArea.setCaretPosition(infoJTextArea.getDocument().getLength());
        private void movingObject()
            testJPanel.setVisible(false);
            resultsJPanel.setVisible(true);
            nameResultJTextField.setText(name);
            ageResultsJTextField.setText(String.valueOf(age)+" years old");
            double elapsedTime = (endTime - startTime)/1000.0;
            timeLimit = (int)elapsedTime;
            timeResultsJTextField.setText(timeDec.format(elapsedTime)+" seconds");
            String mouse = infoJTextArea.getText();
            String tick = timeDec.format(elapsedTime);
            try
                // create a file called welch.txt
                final FileWriter outputFile = new FileWriter(name+".txt", true);
                final BufferedWriter outputBuffer = new BufferedWriter(outputFile);
                // converts data to a formatted string
                final PrintWriter printstream = new PrintWriter(outputBuffer);
                printstream.println("The person's name is: "+name);
                printstream.println("There age is: "+age);
                printstream.println("Time taken: "+tick+" seconds");
                printstream.println("The mouse moved as follows: "+mouse);
                //states what needs to be printed to the new file
                printstream.close(); // closes teh printstream
            catch(IOException eio)
                //catchs the IO exception
            if(timeLimit<5)
                ratingJTextField.setText("Thierry Henry");     
            if(timeLimit>5)
                ratingJTextField.setText("Average");     
            if(timeLimit>10)
                ratingJTextField.setText("You gotta be fat or something");     
            if(timeLimit>20)
                ratingJTextField.setText("See a doctor");
            String rate=ratingJTextField.getText();
        private void showData()
    //        String results = "";
    //        infoJTextArea.setText("Here are your results:\n"+results);
            startJPanel.setVisible(false);
            showJPanel.setVisible(true);
    class ShapeMovingPanel extends JPanel implements ActionListener
        RT host;
        Timer timer;
        Shape shape, xformed;
        int x, y, dx, dy;
        public ShapeMovingPanel(RT rt)
            host = rt;
            timer = new Timer(25, this);
            x = 0;
            y = 0;
            dx = 2;
            dy = 3;
            setBackground(Color.pink);
            addMouseListener(new ShapeTender());
        public void actionPerformed(ActionEvent e)
            int w = getWidth();
            int h = getHeight();
            if(w <= 0 || h <= 0)
                return;
            checkBoundries(w,h);
            x += dx;
            y += dy;
            repaint();
            // update RT.timerJTextField
            host.updateTime();
        private void checkBoundries(int w, int h)
            Rectangle r = xformed.getBounds();
            Insets insets = getInsets();
            if(r.x + dx < insets.left || r.x + r.width + dx > w - insets.right)
                dx *= -1;
            if(r.y + dy < insets.top || r.y + r.height + dy > h - insets.bottom)
                dy *= -1;
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            AffineTransform at = AffineTransform.getTranslateInstance(x, y);
            g2.setPaint(Color.red);
            xformed = at.createTransformedShape(shape);
            g2.draw(xformed);
        public void start()
            if(!timer.isRunning())
                timer.start();
        public void setShape(Shape s)
            shape = s;
            Rectangle r = shape.getBounds();
            x = r.x;
            y = r.y;
            repaint();
        private class ShapeTender extends MouseAdapter
            public void mousePressed(MouseEvent e)
                if(xformed.contains(e.getPoint()))
                    timer.stop();
                    host.stop();
    }

  • How can I edit an animated GIF?

    is there a way to add a animated GIF into your work, when I try to add one I am told that it will be a single layer. I downloaded a GIF from the web and trying to incorparate it into a web site header.

    Well, you are in luck, sort of. You have all the apps needed to create an animated gif. However that does not mean that the image you download was already or not. It could be a single image.
    A couple of things to go over
    1) When downloading from the net make sure you have permission to use that image before sharing with the public, as the image is protected by copyright laws in the US. (Images that state - Permission to use commercially, copyright free, common law licence - Generally are meant to share with the general public, granted that you post somewhere who you got the image from(the Least anyone can do it give credit where credit is due)
    2)Since you have the Master Collection or the CS4 Master Suite, you have every app that is need to create your own works of art. Photoshop, After Effects, Premeire pro are all capable of creating animated gifs. With the latter two being easier than photoshop.
    Since you have CS4 photoshop and this is the photoshop forum, we will keep it there.
    The version of Photoshop that comes in the master suite is the extended version of photoshop which is require for most of the animations it can do. Though, think and am not certain that the standard version can create animated gif files.
    OK, ok we got a lot of mumbo jumbo above so lets get into how to create an animated gif.
    First we need to determine if we are editing an animated gif or creating one from scratch. To load an animated gif all you need to do is file>open then select the file. Simple enough.
    The file will place each frame onto its own layer and if you have the animation panel open (If not select Windows>Animation ) Each frame will be placed there as well.
    Lets say we are going to edit a frame or better yet introduce a new frame. In the upper right hand corner of the animation panel is a small icon. Clicking it will pop up a menu. In that menu select delete animation. Don't worry your layers are safe, it only removes the frames from the animation panel.
    Now you can either change something in one of the layers or add a layer where you want the frame intoduced.
    When you are done you can select that same icon in the animation panel to pop up the menu and select Make frames from layers This will place all the layers back into the animation panel. This has to happen in order to save an animated gif.
    You can now use the File>save to web or File>Save to web and devices (This optiuon changed during one of the version, I don't recall so both are listed or look for something close to that)
    Select Gif for the format then the save button, where you can choose a location and file name. It will automatically add a hyphen between any words that normally are spaces for the web.
    OK, If you read the above, you probably alread realize how to create one from scratch. Just add a new layer for each frame and follow the steps above to add it to the animation panel and save for web.
    I know it sounds like a lot, but once you have done it a few times, it actually fairly simple.
    OK, Bonus round - What about After Effects and Premeire Pro?
    Well both of those apps Use a timeline instead of frames. Which makes them much simpler and more powerful for animations, since that is what they are dedicated to do.
    It is as simple as open the gif file, edit it, save it, done.
    I won't go into how the timeline works as that would require a long , long post. But once you understand it, it is much quicker and can do way more feature wise.
    One last thing, play around with it and see what it can do before commiting time to creating or editing a gif. It goes much easier once you get the hang of it.
    If you have any questions, issues, etc. just post away...
    Well, I got to go, I hope this helps.

  • Creating animated gif's in Photoshop CS5

    I have created identical images in both Photoshop & .gif versions and can't get any of them to work
    The images are saved in an 8 bit  format. There are 8 layers.  the largest version is 761px 760px. 
    When I get the dialog box for "save for web," no matter which version of the images I try, the animation choices are greyed out.  I do not see a check box for "animate" like there is in my Elements 10 dialog box on another system.  What do need to do to be able to save as an animation?

    You need to ensure it's an animation in Photoshop's eyes.
    An animated document is generally maintained with the frames in separate layers.  For example, if you open an animated GIF, it may open each frame into a layer.
    Make the Timeline panel visible (Window - Timeline).
    If the animation doesn't show there, you may need to click the fly-out menu icon at the upper-right corner of the Timeline panel and choose Make Frames from Layers.
    -Noel
    Edit:  Sorry, you said Photoshop CS5.  In that version it's the Animation panel.  Same panel, but renamed in Photoshop CS6 to Timeline.

  • Animated .gif file correction and image ready help.

    Hi,
    I have an animated gif created in an early verison of Image Ready & Photoshop. I need to make some changes. I have two problems.
    A: Can't figure how to do it in the current version of Photoshop.
    B: Open in the old image ready version, can't find the Layers pallet. I turn it on and off and it doesn't appear.
    Trying to recreate a rotating .gif file any pointers or how to's?
    Thanks,
    John

    You didn't say which version of ImageReady, but cs5 should open
    most animated gifs from ImageReady and show the frames in the
    Window>Animation panel. Some may not work right depending on
    how old the version of ImageReady was that created them.
    (you may have to resave the animation in ImageReady as a psd file)
    In ImageReady try Window>Workspace>Reset Palette Locations and the layers
    palette should be visible.
    In ImageReady, in the actions palette, are several actions to rotate (spin) images.
    MTSTUNER

Maybe you are looking for

  • Help. DSL drops connection all the time, is it the modem? (westell 327W)

    Pardon me because I'm not so tech aware, and so don't know what to do to try to find a solution.  We lose our internet connection a lot.  It seems to happen in spurts:  last night we couldn't connect at all, today it was bad in the morning but now I'

  • Soundblaster live! 24bit external 5.1 surround H

    i purchased a new dell m70 and i plan to use it for audio recording mixing ect. and i need to be able to have 5. surround sound. I have been impressed with Creative products, and so i purchased the soundblaster li've external surround card to use wit

  • Problem with OLAP DML

    Dear All, We are using OLAP DML to work with multi-dimensional data on an Analytic workspace. How do you access pre-stored multi dimensional variables set up in a analytic workspace, using OLAP API's. How/Is it possible to load Cube data from a multi

  • XML DB as a web service provider

    Does anyone know where I can find some info/sample programs that use XML DB as a web service provider. I'd like to start publishing PL/SQL packages as web services and can't seem to find anything other than high-level info. Thanks for any responses.

  • AS2 Certificates

    Hi, I have a query with regards to AS2 Encryption and Decruption certificates. Normally for an inbound scenario, we use our certificate to decrypt the message and sign the message. We also send our certificates to customer so that they can encrypt th