Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do i find the centre of the applet  RSS feed

 
david allen
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to draw a Hexagon. How do i set the coords so that it is exactly in the centre of the applet.
thanks david
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at The Applet Class Documentation and notice that an Applet has a getWidth and a getHeight method that it inherits from Component.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!