packetpirate
0
Junior Poster in Training
Recommended Answers
Jump to PostThe math isn't difficult. You have the dimensions of the applet, so you know the center point. That center point is also the center point of the rectangle.
A rectangle in Swing is defined by the top left point and its two sides. The sides will not change - all …
Jump to PostCalculate the center point (appW/2, appH/2) and then use those to figure where to place your upper left corner of the rect.
All 7 Replies
jon.kiparsky
326
Posting Virtuoso
packetpirate
0
Junior Poster in Training
jon.kiparsky
326
Posting Virtuoso
packetpirate
0
Junior Poster in Training
packetpirate
0
Junior Poster in Training
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
packetpirate
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.