File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes one last try Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "one last try" Watch "one last try" New topic
Author

one last try

Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 256
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: 24166
    
  30

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: 256
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: 256

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: 24166
    
  30

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: 256
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: 24166
    
  30

Have a look around the Bunkhouse.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: one last try
 
Similar Threads
Counter Instance Variable
JBuilder And MVC Architecture
How to checker user enter is palindrome
Beginners question (Head First - TwoButtons)
what is "better" ...