• Post Reply Bookmark Topic Watch Topic
  • New Topic

can help me solve this drawing ?  RSS feed

 
Phone Myat Kyaw
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Can someone help how to write using while loops and drawLine() function only to get such image output ? This is from Deitel: Java How to Program 6ed and I finally give up
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you have so far, and where are you stuck making progress?

If you're interested in graphics, maybe you get some inspiration out of the MiceProblem.
 
Phone Myat Kyaw
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
What do you have so far, and where are you stuck making progress?

If you're interested in graphics, maybe you get some inspiration out of the MiceProblem.


Thanks for your advice but my case is (afraid to admit though) I don't even know where to start to get such output using only while loop and drawLine(x1,y1,x2,y2) function
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you look at the code I linked to? It uses the drawLine method in a loop (granted, it's a for loop, not a while loop, but that makes little practical difference). That's why I said it might provide you with some inspiration.
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Deitel and Deitel code is quite clear, and is printed in the book; please explain what problem you are having.

And that sort of thing would sit better on the Swing forum: moving.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!