File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Toolkit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Toolkit" Watch "Toolkit" New topic
Author

Toolkit

Mario Skrlec
Greenhorn

Joined: Apr 15, 2012
Posts: 20
Greetings, everybody.

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?

Here it is
http://docs.oracle.com/javase/7/docs/api/java/awt/Toolkit.html#getScreenSize%28%29
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7652
    
  19

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..."

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Mario Skrlec
Greenhorn

Joined: Apr 15, 2012
Posts: 20
Thank you for the answer
 
 
subject: Toolkit