• Post Reply Bookmark Topic Watch Topic
  • New Topic

AffineTransform with Graphics2D on JInternalFrame

 
Rob Bartnicki
Greenhorn
Posts: 4
Java Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to AffineTransform but I spent a couple of hours and kind of figured out how to get it to do what I want. Basically my goal is the make a JInternal Frame that scales the Graphics2D objects when it is minimized. For proof of concept I have created some code that scales with the mouse wheel and is translated on a mouse drag.

My question is, how can I package this into a JInternalFrame that scales when the JInternalFrame is minimized? Also, is there a better way to do what I want to do?

Self contained example:

 
Campbell Ritchie
Marshal
Posts: 52587
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't override the paint method.

Start simple, as I said before. Try it with one panel, and get used to transforms. Whatever works on a panel, you can transfer to an internal frame. Or more probably to a panel on an internal frame.
 
Rob Bartnicki
Greenhorn
Posts: 4
Java Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Campbell Ritchie Perhaps I am overthinking this but how would you do the transform without overloading the paint method? Can you provide an example?
 
Campbell Ritchie
Marshal
Posts: 52587
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already have told you once. Are you overloading paint()? In which case nothing will happen because an overloaded paint() will never be called.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!