aspose file tools
The moose likes Beginning Java and the fly likes Toolkit Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 4748
    
    7

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?
Mario Skrlec
Greenhorn

Joined: Apr 15, 2012
Posts: 20
Thank you for the answer
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Toolkit
 
Similar Threads
Screen Position
Beep sound - How to generate?
Screen Size
Question about calling Abstract Methods.
about Toolkit