I have a question about the getScreenSize() method in the Toolkit class. That method is abstract and yet, it returns a Dimension
object with which i can evaluate width and height of a particular screen. Toolkit is abstract, setScreenSize() is abstract so
how does it work if it isnt defined?
Mario Skrlec wrote:Toolkit is abstract, setScreenSize() is abstract so how does it work if it isnt defined?
Almost certainly, you actually use a concrete Toolkit (ie, a subclass) that is applicable to your Desktop system. I notice it also dates from version 1.0; I suspect that these days it might have been made an interface.
It's also worth noting that the documentation says:
"Most applications should not call any of the methods in this class directly. The methods defined by Toolkit are the "glue" that joins the platform-independent classes in the java.awt package with their counterparts in java.awt.peer..."
Isn't it funny how there's always time and money enough to do it WRONG?