Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Nov 6th, 2006, 10:14 AM   #11
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,650
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
First off there is no need for the sarcasm and rudeness against the new member.

@kenny1591: Please read through the rules here at Programming forums
http://www.programmingforums.org/for...q=faq_policies

If you look up at your code you posted (I have added the [highlight] tag to your code to preserve the formatting. If you look at it your closing brackets are not in the right places. You are not closing paintComponent. You have enough } but you have 2 of them at the very bottom and you need another one before main. If you look at the code you should see that. You will also need to remove one of the extra ones. Something like this.

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. } // <= Look here and again at the very bottom
  41.  
  42. public static void main(String[] args)
  43. {
  44. JFrame window = new JFrame("Walker");
  45. window.setBounds(100, 100, 500, 480);
  46. window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  47.  
  48. WalkerTest panel = new WalkerTest();
  49. panel.setBackground(Color.WHITE);
  50. Container c = window.getContentPane();
  51. c.add(panel);
  52.  
  53. window.setVisible(true);
  54. }
  55. }
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is online now   Reply With Quote
Old Nov 6th, 2006, 5:19 PM   #12
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 582
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
I'm not being sarcastic or rude. I am just telling him what I was always told when I wanted people here to do my homework. And I think some other members would agree that we don't do homework for people here. We will help them but we will NOT do it.
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Old Nov 6th, 2006, 6:22 PM   #13
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,650
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
I agree we shouldn't do people's homework for them, because that makes people lazy. But once he gave code showing what he had done, then there was no need for anything to be said except, to help with the code. I do think all the sarcasm and rudeness on this forum needs to stop, I mean we are all adults here and we should be able to act civil with each other. I understand he hadn't used the code tag but a simple please use the [code][/code] or [highlight=<language>][/highlight] would have been enough or simply reporting the post to a moderator, so we could deal with the post would have also been enough to solve the problem.
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is online now   Reply With Quote
Old Nov 6th, 2006, 9:16 PM   #14
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
I agree with you to a large extent, Kyle, but the history is not conducive to the most civilized behavior. The OP's first thread received this response:
Quote:
Why don't you read the forum's FAQ/rules to learn about the importance of including enough information in your request to engender suitable responses.
That's not uncivil. The OP then double posted, which is a clear indication of ignoring the advice to read the rules. That was followed by a more sarcastic response,
Quote:
Do not double post. Do not cross post. Do not pass Go. Do not collect $200. Do go read the danged rules.
After STILL failing to read the rules, that was followed by yet another response (these quoted responses are all mine),
Quote:
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.
A person who is unwilling to even read the rules, when asked, can expect to be the subject of rancor. There is, for instance, another new member who has repeatedly refused to adhere to the rules regarding signatures. I've said no more about that, but it's indicative of an attitude that is an incivility, in itself.
__________________
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, 10:30 PM   #15
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 582
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
Agreed
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Old Nov 6th, 2006, 11:57 PM   #16
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
How are we even to know what excercise 7 through 15 are ... Yes, we all have your exact Java text in our collection.
__________________

tempest 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 10:58 AM
Special browser in Java (Project) stalefish Java 3 Feb 9th, 2008 4:22 PM
Java Methods AB davidsq Java 4 Nov 5th, 2006 5:46 PM
First Java Program duale2005 Java 3 May 22nd, 2006 5:17 PM
Java programmers, game developers, artists, be ware! RPG game team is recruiting! atcomputers.us Paid Job Offers 7 Sep 25th, 2005 7:25 PM




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

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