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.
スイングでは、その変換が許可されます
paint (Graphics g) { Graphics2D g2d = (Graphics2D) g; ...... }
常に動作しますか?または、Graphics2D だけでなく、さまざまなグラフィックスの実装が存在する可能性がありますか?
短い答えは、はい、他のJVMを使用していない限り、動作するはずです。正確な時期は覚えていませんが、Swings ペイント エンジンは常に Graphics2D インスタンスを使用してコンポーネントのペイントを実行します。