Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 5th, 2006, 7:20 PM   #1
kenny1591
Newbie
 
Join Date: Nov 2006
Posts: 4
Rep Power: 0 kenny1591 is an unknown quantity at this point
Java Methods A and AB

Please help me with the chapter 3 exercises 7 through 15. Your help will be highly appreciated.
kenny1591 is offline   Reply With Quote
Old Nov 5th, 2006, 7:26 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Do not double post. Do not cross post. Do not pass Go. Do not collect $200. Do go read the danged rules.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 5th, 2006, 7:28 PM   #3
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 935
Rep Power: 4 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Excercises 7 through 15? No problem. I'll go do them for you and send you the answers later.

/sarcasm
titaniumdecoy is online now   Reply With Quote
Old Nov 5th, 2006, 7:42 PM   #4
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 4 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
I need a new car! Anyone willing to buy me one?
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old Nov 5th, 2006, 7:55 PM   #5
AntiNinja
Hobbyist Programmer
 
AntiNinja's Avatar
 
Join Date: Jun 2006
Location: The States
Posts: 101
Rep Power: 3 AntiNinja is on a distinguished road
Send a message via AIM to AntiNinja Send a message via Yahoo to AntiNinja
Man, I sure do wish they made internet guns...
__________________
Pain is just weakness leaving the body.
AntiNinja is offline   Reply With Quote
Old Nov 5th, 2006, 9:13 PM   #6
kenny1591
Newbie
 
Join Date: Nov 2006
Posts: 4
Rep Power: 0 kenny1591 is an unknown quantity at this point
i'm looking for help, not sarcasm, new cars, and internet guns:banana:
kenny1591 is offline   Reply With Quote
Old Nov 5th, 2006, 9:19 PM   #7
kenny1591
Newbie
 
Join Date: Nov 2006
Posts: 4
Rep Power: 0 kenny1591 is an unknown quantity at this point
how do i fix an illegal start of expression error on this program


java Syntax (Toggle Plain Text)
  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:

Last edited by big_k105; Nov 6th, 2006 at 11:10 AM. Reason: added code tags
kenny1591 is offline   Reply With Quote
Old Nov 5th, 2006, 9:54 PM   #8
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 6th, 2006, 12:19 AM   #9
xavier
Professional Programmer
 
xavier's Avatar
 
Join Date: Oct 2004
Location: .ro
Posts: 406
Rep Power: 5 xavier is on a distinguished road
Send a message via Yahoo to xavier
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.
__________________
Don't take life too seriously, it's not permanent !
xavier is offline   Reply With Quote
Old Nov 6th, 2006, 12:24 AM   #10
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 597
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
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)
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming with Java: Tutorial ReggaetonKing Java 7 May 20th, 2008 11:58 AM
Special browser in Java (Project) stalefish Java 3 Feb 9th, 2008 5:22 PM
Java Methods AB davidsq Java 4 Nov 5th, 2006 6:46 PM
First Java Program duale2005 Java 3 May 22nd, 2006 6:17 PM
Java programmers, game developers, artists, be ware! RPG game team is recruiting! atcomputers.us Paid Job Offers 7 Sep 25th, 2005 8:25 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:27 PM.

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