• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do i find the centre of the applet

 
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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!