Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   Java Methods A and AB (http://www.programmingforums.org/showthread.php?t=11811)

kenny1591 Nov 5th, 2006 6:20 PM

Java Methods A and AB
 
Please help me with the chapter 3 exercises 7 through 15. Your help will be highly appreciated.

DaWei Nov 5th, 2006 6:26 PM

Do not double post. Do not cross post. Do not pass Go. Do not collect $200. Do go read the danged rules.

titaniumdecoy Nov 5th, 2006 6:28 PM

Excercises 7 through 15? No problem. I'll go do them for you and send you the answers later.

/sarcasm

ReggaetonKing Nov 5th, 2006 6:42 PM

I need a new car! Anyone willing to buy me one?

AntiNinja Nov 5th, 2006 6:55 PM

Man, I sure do wish they made internet guns...

kenny1591 Nov 5th, 2006 8:13 PM

i'm looking for help, not sarcasm, new cars, and internet guns:banana:

kenny1591 Nov 5th, 2006 8:19 PM

how do i fix an illegal start of expression error on this program


:

  1. import java.awt.Graphics;
  2. import java.awt.Color;
  3. import java.awt.Image;
  4. import java.awt.Container;
  5. import javax.swing.JFrame;
  6. import javax.swing.JPanel;
  7. import javax.swing.ImageIcon;
  8.  
  9. public class WalkerTest extends JPanel
  10. {
  11.         private Image leftShoe;
  12.         private Image rightShoe;
  13.  
  14.         // Constructor
  15.         public WalkerTest()
  16.         {
  17.                 leftShoe = (new ImageIcon("leftShoe.gif")).getImage();
  18.                 rightShoe = (new ImageIcon("rightShoe.gif")).getImage();
  19.         }
  20.  
  21.         // Called automatically when the panel needs repainting
  22.         public void paintComponent(Graphics g)
  23.         {
  24.                 super.paintComponent(g);
  25.  
  26.                 int x = 300;
  27.                 int y = 100;
  28.                 int stepLength = 100;
  29.  
  30.                 Walker walker = new Walker(x, y, leftShoe, rightShoe);
  31.                 for (int count = 1; count <= 8; count++)
  32.                 {
  33.                         walker.draw(g);
  34.                         walker.nextStep();
  35.  
  36.                         // Draw a cursor at the expected center of the first "shoe"
  37.                         g.drawLine(x - 50, y, x + 50, y);
  38.                         g.drawLine(x, y - 50, x, y + 50);
  39.                 }
  40.  
  41.         public static void main(String[] args)
  42.         {
  43.                 JFrame window = new JFrame("Walker");
  44.                 window.setBounds(100, 100, 500, 480);
  45.                 window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  46.  
  47.                 WalkerTest panel = new WalkerTest();
  48.                 panel.setBackground(Color.WHITE);
  49.                 Container c = window.getContentPane();
  50.                 c.add(panel);
  51.  
  52.                 window.setVisible(true);
  53.         }
  54. }
  55. }






On the line that says:
public static void main(String[] args)




Please help.:banana: :banana: :banana: :banana: :banana: :banana:

DaWei Nov 5th, 2006 8:54 PM

You still haven't read the rules, or else you can't comprehend. Code is supposed to be put in tags to preserve its formatting and readability. A recalcitrant ass isn't likely to get much help; perhaps you could appeal to your bananas.

xavier Nov 5th, 2006 11:19 PM

You didn't correctly close your {} {} { }{ } :). I won't tell you wich one, cause you didn't use code tags and the code is not indented. :P

crawforddavid2006 Nov 5th, 2006 11:24 PM

Ok. I'll help you. First of all use CODE TAGS. second of all when you program INDENT THINGS. and third. i'll do you homework for you if you have enough money. i think other people charge more than me so my rate is $50.00 a problem(no sarcasm)


All times are GMT -5. The time now is 1:24 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC