I need help with animation, PLEASE help!

I am trying to create pacman animation by using a series of filled arcs that I create by coding in java. I know how to create the arcs, but I don't know how to use them to create animation. In other words I don't know how to put them in sequence to create animation.
I have searched the web, and all I find is animation that use a series of GIF or JPEG images.
can you please help me or point me to the right direction.
by the way, which of these two animation would run faster? The one that uses GIF images, or the one that would use shapes created in java?
Thanx

Perhaps you could do this two ways
One way, (im not sure if this will work), is to create a .gif file that is already animated. An open mouth animated to a closed mouth. But i don't know if Java will accept this.
The second way would be to create a Thread. And to create however many images you want to display the open to closed mouth. Then continuously change the image so it appears the mouth is opening and closing.
Put in a delay so it doens't go too fast, and there ya have it.
Public void run()
int i =0;
while(true)
myThread.sleep(10);
image = difImage;
}something like that. Might used a bufferedImage and make just use subImage to pull off each picture you need to change.

Similar Messages

  • Need guidance with animated table

    Hi,
    I believe I need to write my own custom table drawer. The requirements of the table:
    Main one that differ from JTable
    Cells can scroll to the left or right and up or down on key press(animated-not simply changing the cell values)
    An example is the TV guide channel only mine will also scroll left and right.
    Standard table stuff
    Cells can have images and/or text
    Cells bgcolor can be modified
    Cells can span multiple columns.
    Any cell can be selected/highlighted
    All cells content must be antialiased
    Can someone please give me some direction on how to do this? Should I just start hacking away using the standard Graphics2D class? How should I handle the scrolling? Can I somehow use the JTable class with animated scrolling? I'm just worried about efficiency if I create my own class with the Graphics2D class. The table will usually be about 100 rows by 5 columns full of data (text and images).
    Thanks, sorry for sounding somewhat newbish :)

    Hi there,
    You have to implement your own JTable. I never had to deal with JTable before but here is how you could start...
    public class MyJTable {
      public MyJTable() {
        //modify the behavior here...
      public void paintComponent(Graphics g) {
        //paint your JTable the way you want... 
    }The performance may be an issue if you will use animations. Let me know if you need any more help.
    Berk Can Celebisoy

  • If i reset my ipad can i install paye games for free if i sign back into my apple ID. Please i need help because i need to update my games but i need to put in this billing thing and i want to get rid of it so then i cant buy games with my credit card

    If i reset my ipad can i install paye games for free if i sign back into my apple ID. Please i need help because i need to update my games but i need to put in this billing thing and i want to get rid of it so then i cant buy games with my credit card

    Hello,
    As frustrating as it seems, your best to post any frustrations about the iPhone in the  iPhone discussion here:
    https://discussions.apple.com/community/iphone/using_iphone
    As this discussion is for iBook laptops.
    Best of Luck.

  • Need help to draw a graph from the output I get with my program please

    Hi all,
    I please need help with this program, I need to display the amount of money over the years (which the user has to enter via the textfields supplied)
    on a graph, I'm not sure what to do further with my program, but I have created a test with a System.out.println() method just to see if I get the correct output and it looks fine.
    My question is, how do I get the input that was entered by the user (the initial deposit amount as well as the number of years) and using these to draw up the graph? (I used a button for the user to click after he/she has entered both the deposit and year values to draw the graph but I don't know how to get this to work?)
    Please help me.
    The output that I got looked liked this: (just for a test!) - basically this kind of output must be shown on the graph...
    The initial deposit made was: 200.0
    After year: 1        Amount is:  210.00
    After year: 2        Amount is:  220.50
    After year: 3        Amount is:  231.53
    After year: 4        Amount is:  243.10
    After year: 5        Amount is:  255.26
    After year: 6        Amount is:  268.02
    After year: 7        Amount is:  281.42
    After year: 8        Amount is:  295.49
    After year: 9        Amount is:  310.27
    After year: 10        Amount is:  325.78
    After year: 11        Amount is:  342.07
    After year: 12        Amount is:  359.17
    After year: 13        Amount is:  377.13
    After year: 14        Amount is:  395.99
    After year: 15        Amount is:  415.79
    After year: 16        Amount is:  436.57
    After year: 17        Amount is:  458.40And here is my code that Iv'e done so far:
    import javax.swing.*;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.lang.Math;
    import java.text.DecimalFormat;
    public class CompoundInterestProgram extends JFrame implements ActionListener {
        JLabel amountLabel = new JLabel("Please enter the initial deposit amount:");
        JTextField amountText = new JTextField(5);
        JLabel yearsLabel = new JLabel("Please enter the numbers of years:");
        JTextField yearstext = new JTextField(5);
        JButton drawButton = new JButton("Draw Graph");
        public CompoundInterestProgram() {
            super("Compound Interest Program");
            setSize(500, 500);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            amountText.addActionListener(this);
            yearstext.addActionListener(this);
            JPanel panel = new JPanel();
            panel.setBackground(Color.white);
            panel.add(amountLabel);
            amountLabel.setToolTipText("Range of deposit must be 20 - 200!");
            panel.add(amountText);
            panel.add(yearsLabel);
            yearsLabel.setToolTipText("Range of years must be 1 - 25!");
            panel.add(yearstext);
            panel.add(drawButton);
            add(panel);
            setVisible(true);
            public static void main(String[] args) {
                 DecimalFormat dec2 = new DecimalFormat( "0.00" );
                CompoundInterestProgram cip1 = new CompoundInterestProgram();
                JFrame f = new JFrame();
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                f.getContentPane().add(new GraphPanel());
                f.setSize(500, 500);
                f.setLocation(200,200);
                f.setVisible(true);
                Account a = new Account(200);
                System.out.println("The initial deposit made was: " + a.getBalance() + "\n");
                for (int year = 1; year <= 17; year++) {
                      System.out.println("After year: " + year + "   \t" + "Amount is:  " + dec2.format(a.getBalance() + a.calcInterest(year)));
              @Override
              public void actionPerformed(ActionEvent arg0) {
                   // TODO Auto-generated method stub
    class Account {
        double balance = 0;
        double interest = 0.05;
        public Account() {
             balance = 0;
             interest = 0.05;
        public Account(int deposit) {
             balance = deposit;
             interest = 0.05;
        public double calcInterest(int year) {
               return  balance * Math.pow((1 + interest), year) - balance;
        public double getBalance() {
              return balance;
    class GraphPanel extends JPanel {
        public GraphPanel() {
        public void paintComponent(Graphics g) {
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setColor(Color.red);
    }Your help would be much appreciated.
    Thanks in advance.

    watertownjordan wrote:
    http://www.jgraph.com/jgraph.html
    The above is also good.Sorry but you need to look a bit more closely at URLs that you cite. What the OP wants is a chart (as in X against Y) not a graph (as in links and nodes) . 'jgraph' deals with links and nodes.
    The best free charting library that I know of is JFreeChart from www.jfree.org.

  • I have problem with buying in games , I got the massage that the purchased can not be completed , please contact iTunes support.. I need help for my case please

    I have problem with buying in games , I got the massage that the purchased can not be completed , please contact iTunes support.. I need help for my case please

    http://www.apple.com/support/itunes/contact/

  • I actually need help but cannot find the answer. Please.......Lately when open a new tab it does not open with a blank page. I don't want to set my homepage as

    I actually need help but cannot find the answer.
    Please.......Lately when open a new tab it does not open with a blank page. I don't want to set my homepage as blank as when I first open Firefox, it automatically loads my hotmail page. But then if I open other pages I don't get a blank page. Help, please?
    Thank you.
    ''[Personal information removed by moderator. Please read [[Forum and chat rules and guidelines]], thanks.]''

    hello, please refer to [[New Tab Page – show, hide and customize top sites]] in order to switch the feature off.

  • HT4061 need help with my iphone 4 i try to update last five  days but after updating to 6.1.2  it says that    We're sorry, we are unable to continue with your activation at this time. Please try again later, or c

    need help with my iphone 4 i try to update last five  days but after updating to 6.1.2  it says that
    We're sorry, we are unable to continue with your activation at this time. Please try again later, or c

    If the iPhone was hacked and unlocked via unofficial means, it has become locked again. Insert original SIM in the phone to activate with iTunes.

  • I just bought a new iPhone and accidentally backed it up with my old iPhone backup, I do not want this. I lost everything on my new phone and I need it back. PLEASE HELP! This includes pictures and texts, etc.

    I just bought a new iPhone and accidentally backed it up with my old iPhone backup, I do not want this. I lost everything on my new phone and I need it back. PLEASE HELP! This includes pictures and texts, etc.

    So just to be clear, when you say "just bought" how long ago was that? Is it on this new iPhone that you had pictures, texts, etc that you want? Were you backing up to iCloud or onto iTunes?
    This may not help for everything but if you go to iCloud.com and log in, are you able to find your pictures there?

  • Hi can anyone help me. I have a apple macbook laptop OSX 10.5.8 . When i push print, it shows my printer but says cannot communicate with printer. (epson stylus nx125). Do I need new drivers? Please help .  regards Cindy

    Hi can anyone help me. I have a apple macbook laptop OSX 10.5.8 . When i push print, it shows my printer but says cannot communicate with printer. (epson stylus nx125). Do I need new drivers? Please help .  regards Cindy

    Welcome to Apple Support Communities. We're users here and do not speak for "Apple Inc."
    Some basic printer troubleshooting steps before worrying about a printer driver:
    1. Have you tried turning the printer off and back on?
    2A. Is the printer attached with a cable?
         If yes, have you tried unplugging and re-plugging both ends of the printer cable?
         If that does not help, can you test the printer with another cable?
    2B. If your printer is not connected to the computer with a cable, have you tried restarting your printer (assuming wireless connection)?
         Have you tried restarting your wireless router?
    3. Have you tried restarting your MacBook? (Be sure to save your work first.)
    4. Does the printer have ink? (Doesn't usually generate a 'communications error' though)
    5. Have you updated OS X or the program you're trying to print from recently?

  • Need help to find photo's on my backup drive,since installing Mountain Lion cannot find where they are stored.The backups after ML install are greyed out except in Applications, MyFiles and Devices really welcome a hand with this please.

    I need help to find my photo's please (2500) on my backup drive.Lost them after doing a clean install of Mountan Lion I have tried to find them but had no luck.  I use Time Machine with a 1TB Western Digital usb drive. Thanking anyone in anticipation of a solution.

    -Reece,
    We only have 1 single domain, 1 domain forest, no subdomains, only alias. I had replied to the other post as well. But I am happy to paste it here in case anyone want to read it.
    So, after a few months of testing, capture and sending logs back and forth to Apple Engineers, we found out there is a setting in AD, under User Account that prevent us to log into AD from Mountain Lion. If you would go to your AD server, open up a user account properties, then go to Account tab, the "Do not require Kerberos preauthentication" option is checked. As soon as I uncheck that option, immediately I was able to log into AD on the Mac client. Apple engineers copied all my AD settings and setup a test environment on their end and match exact mine AD environment. They was able to reproduce this issue.
    The bad part about this is... our environment required the "Do not require Kerberos preauthentication" is checked in AD, in order for our users to login into some of our Unix and Linux services. Which mean that it is impossible for us to remove that check mark because most, if not all of them some way or another require to login into applications that run on Unix and Linux. Apple is working to see if they can come up with a fix. Apparently, no one has report this issue except us. I believe most of you out there don't have that check mark checked in your environment... Anyone out there have any suggestion to by pass or have a work around for this?

  • Help me please... need support with recovery on M305D-S483​1

    So I know I created the applications 1of1 disk, but for whatever reason it won't run.
    And I know I chose NOT to make the recovery disks (dumb I know) because there was that hidden partition on my disk to recover that way...
    Well now I need to recover, and when I press the zero key, I see the black screen appear with the words "HDD RECOVERY MODE" at the bottom, but then they disapear and the system boots up normally. It doesn't goto the RED LETTER screen.
    I've tried it several times... 
    I went into windows disk manager and the partition is there, but I can't seem to figure out how to get it to run or show me what's there. So I can make those disks... Can I just reinstall that toshiba software that makes the disks? Where would I find it, and what's it called?
    So, if I can, I need help getting that partition to load so I can wipe out my C drive and start over.
    If I can't, It makes no sense to pay Toshiba $30 for a set of recovery disks, that should be on the computer... (if that partition got wiped, it got wiped BY Toshiba when I sent my computer in for service, because I've not even THOUGHT about that partition since I bought the computer in 2008.) then I need to find another drive from another laptop, and change out the key code (i pulled the code off my computer with a key finder software thingi) or is there another way of me getting my vista back on here...
    I could have upgraded to windows 7 for $40, why would I want to pay $30 to Toshiba for something that's on my disk... 
    I'm a bit miffed right now, if you all couldn't tell... 
    Please let me know what I can do before I just throw out the whole computer in the trash. (I know it's old but it's what I have right now and would really like to get it working again)
    Thanks for your ear and help.

    You can try tapping f8 at start up to get to advanced start up options. Select safe mode, you can try to make recovery media from there. ( Start, all programs, Toshiba, support & recovery, recovery media creator )
    Let us know!
    Your support page is here :  http://support.toshiba.com/support/modelHome?freeT​ext=2060041
    Your manual, specs, and downloads are located there. 
    S70-ABT2N22 Windows 7 Pro & 8.1Pro, C55-A5180 Windows 8.1****Click on White “Kudos” STAR to say thanks!****

  • I need help with a PDF file that is an image, the "Read Out Loud' option does not work, please help!

    I need help with a PDF file that is an image, the "Read Out Loud' option does not work, please help!

    You mean an image such as a scanned document?
    If that is the case, the file doesn't contain any text for Reader Out Loud to read. In order to fix that, you would need an application such as Adobe Acrobat that does Optical Character Recognition to convert the images to actual text.
    You can also try to export the file as a Word document or something else using ExportPDF which I believe offers OCR and is cheaper than Acrobat.

  • TS1702 Hello, I,m having problems with Polish spell check. It says in iPnstruction that this App (pages) should show my writing mistakes. Check spell button is on but but check spell is not working. Need help Please.

    Hello, I,m having problems with Polish spell check. It says in iPnstruction that this App (pages) should show my writing mistakes. Check spell button is on but but check spell is not working. Need help Please.

    Hello, I,m having problems with Polish spell check. It says in iPnstruction that this App (pages) should show my writing mistakes. Check spell button is on but but check spell is not working. Need help Please.

  • Need Help Please with Ipod 20G

    Long story short....I had my Ipod 4G and computer stolen several month ago on a business trip(have police report). A friend of mine recently purchased a new Video Ipod and gave me his old 20G...pretty nice of him! I am about to have iTunes loaded on to my new computer. Here are my questions I need help with please.
    1. Will I need to setup a new iTunes account or can I use my old one?
    2. Will I have to reset my newly acquired Ipod before I can place my music on it? I did back up about 80% of the songs from my old Ipod. Or will I be able to keep the 1500 songs my friend placed on it?
    3. Or would it be easier for me to give him back his, cough up the $300 dollars for a new one and start all over?
    Can't think of anything else I might need to know. If there is something I am missing and you could help fill in the blanks for me I would truly appreciate the help.
    Thanks so much!!
    20G   Windows 2000  
    20G   Windows 2000  

    1. No. You can use your old one.
    2. Will I have to reset my newly acquired Ipod before I can place my music on it? No, but iTunes may automatically do this, I will explain.
    I did back up about 80% of the songs from my old Ipod. Or will I be able to keep the 1500 songs my friend placed on it?
    Sorry, but it would not be legal to keep the 1500 songs on this iPod that were your friend's songs, assuming that he's still using/listening to them on another computer.
    3. No, I think it would be worth it to keep going, and use the 20GB iPod on your computer. It's not many hoops to jump through, and you should be up and syncing in no time.
    Overall, it's fairly easy, and I would suggest that you keep going with this iPod.
    My note from question #2:
    If you connect an iPod that hasn't been attatched to your computer before, iTunes will most likely display [to the effect of] this message when you connect the iPod for the first time:
    "The songs on the iPod "~~" are linked to another iTunes library. Would you like to replace the content of the iPod with this current iTunes library?"
    Be sure to click on "NO" when you recieve this message.
    Then, click on your iPod's name in the left panel of iTunes.
    Click on the "Music" tab.
    Deselect "Sync Music" if it is already set to this option.
    This means that your iPod is on manual managing now, instead of iTunes automatically transferring songs to your iPod, or deleting them, which is not what you want at this time.
    Now, if you have any songs on the iPod that you need to keep (i.e., if you have some of your songs on this iPod)you have a few options to transfer your iPod songs to your computer.
    Method 1 - Manually transfer your iPod songs to iTunes using MacMuse's post. See it here -> iPod songs to computer (MacMuse post)
    Method 2 - Add your iPod's folder into the iTunes library (via iTunes). Read this post here -> Using iTunes settings to transfer iPod songs to iTunes
    Method 3 - Use a third-party program to get the transferring done. For a Windows computer, CopyPod should work good. Also, you can try out YamiPod
    I hope that info helps you.
    -Kylene

  • Need help with animation, for my XAML game

    Hello friends,
    I need help in creating animation for my snake and ladder game(C#,XAML). I have completed the game logic, but can't understand how to animate my UI.
    1. I want to animate 6 dice images so that when the player clicks on the Roll Dice Button a shuffle animation will play, and while the animation is playing the user can't click any thing.
    2. I want the player disc to move one step at a time (animation) on the game board.
    Please help me I am new to animation. Kindly give a reply

    Hello,
    I would recommend using
    Storyboards and / or the
    XAML animation library.
    Other resources:
    Storyboarded animations (XAML)
    XAML animation library sample
    I hope this helps,
    James
    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

Maybe you are looking for

  • Adding new backgrounds to Photoshop Elements 11

    Hi I have recently purchase Photoshop Elements 11 and i am wanting to transfer all my backgrounds and graphics to the program.  I located the Photo Creations folder and pasted my backgrounds in the "Backgrounds' folder but when going back into the pr

  • LR hangs when after editing .tif image try to edit .NEF file

    LR CC Trial hang ups after: Open LR CC Edit .tif file created by PS CC trial Go back to the grid of thumbnails Edit (try) a .NEF I am working with a catalog ex LR 5.4 This is the four time in a row that happens this. Both photos are "normal" files (n

  • Schedule sent messages

    Can anyone tell me where to find a schedule to sent messages in a specific time and day, in Apple mail ?

  • ODI 11g new features

    Hi All, Does anybody know how to set up single sign on in ODI 11g? Thank You, Santhosh

  • Div or iFrame resize depending on content.

    Can you hide a div unless you make it visible when being clicked? How? I have tried to use an iFrame for this, but cannot make it right. I cannot make the div being resized depending on the content of the page being targeted. That is why I have thoug