Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
原点をコンポーネントの左上から中央下に移動しますか?AffineTransformクラスで遊んでいますが、動作させることができませんでしたか?
描画しようとしているコンポーネントの高さと幅が必要になります。あなたがその方法にいると仮定するとpaint(Graphics g)、最も簡単な方法は次のとおりです。
paint(Graphics g)
paint(Graphics g){ Graphics2D g2 = (Graphics2D)g; g2.translate( component.getWidth()/2.0, component.getHeight()/2.0); //... }