| Author |
one last try
|
Pranav Sharma
Ranch Hand
Joined: Oct 27, 2003
Posts: 254
|
|
ok i will give it one last try.. and rephrase the question. i have a set of lines on a jframe frame. now once iam in main after show(), i want to redraw these lines with new cordinates. how do i do this. thank u and sorry for the trouble
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24054
|
|
Do it the same way you drew them the first time, but with new coordinates? Sorry, I know that's not helpful, but this isn't a very clear question. Apparently you've asked it before and not gotten an answer (by the way, if you had posted this as a follow-up to your earlier question, then I'd be able to read all the different versions together, and maybe all together, they'd make sense. But this one by itself, I can't really understand.) Maybe if you showed us some code, in a reply on this same thread, then your question would make more sense. Also, please use the UBB "CODE" tags to format your code -- otherwise, we won't be able to read it.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Pranav Sharma
Ranch Hand
Joined: Oct 27, 2003
Posts: 254
|
|
thank u ernest. iam a beginner at this. I understand that i will have to redraw with the new cordinates. the problem is i dunno how exactly to do that. my code is simple the paint method contains calls to draw lines and oval shapes. and then in public static void main(){ (code) . . . obj.show() } this creates the frame and then the figures in them. now after show if i have to redraw the shapes what and where to do i add the code to repaint. hope this is clears it up a lil bit thank u
|
 |
Pranav Sharma
Ranch Hand
Joined: Oct 27, 2003
Posts: 254
|
|
this is the code i have, now i want to redraw the lines and oval points with new cordinates. what piece of code would i have to add for this and where would i have to add. thank u
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24054
|
|
Ah, OK. Well, there are several ways you could do this, but here's one simple suggestion: replace your paint() method with this: And in main(), when you want the picture to change, set paintMode to some non-zero value and then call f.repaint(). OK?
|
 |
Pranav Sharma
Ranch Hand
Joined: Oct 27, 2003
Posts: 254
|
|
works like a charm thank u any books you can recommend on java
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24054
|
|
|
Have a look around the Bunkhouse.
|
 |
 |
|
|
subject: one last try
|
|
|