• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Toolkit

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the answer
 
I wasn't selected to go to mars. This tiny ad got in ahead of me:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic