• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

one last try

 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Pranav Sharma
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
works like a charm
thank u
any books you can recommend on java
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look around the Bunkhouse.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic