With swing is it granted that conversion
paint (Graphics g) {
Graphics2D g2d = (Graphics2D) g;
......
}
will always work? Or there could be different graphics implementations, not only Graphics2D?
With swing is it granted that conversion
paint (Graphics g) {
Graphics2D g2d = (Graphics2D) g;
......
}
will always work? Or there could be different graphics implementations, not only Graphics2D?
Short answer is, yes it should work, unless you're using some other JVM. I can't remember since when exactly, but Swings paint engine will always use a Graphics2D instance to perform its component painting