This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Toolkit

 
Mario Skrlec
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10498
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mario Skrlec
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the answer
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic