Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Graphics2D  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I want to have something like a speedometer. I draw it with Java2D

If I have now an event, then I want to change to position of "filledPolygon". How can I do that?
I found out, that i can translate the Graphics2D-Object, but this does not affect on my already created "filledPolygon" !
Any ideas?
Thanks, Flavio
[ May 27, 2003: Message edited by: Flavio Grisch ]
[ May 27, 2003: Message edited by: Flavio Grisch ]
[ May 27, 2003: Message edited by: Flavio Grisch ]
 
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are doing this inside the paint() method of an AWT component, or the paintComponent() method of a Swing component, you'll simply update all of the values you need to (i.e. x, y, yo1, yu1, x1, x2, yo2, etc.), and then call repaint().
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!