Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Getting the current frame size

  Asked By: Cesar    Date: Jun 25    Category: Java    Views: 3855

I'm making this program that a tank bean is not allowed to move
beyond the boundaries of the frame wherein it moves. No matter how
much the tank moves, it will always be visible. How would i be able
to do that? I'm trying all the methods that i can think but it still
not working. anybody who can help?



2 Answers Found

Answer #1    Answered By: Chad Bradley     Answered On: Jun 25

Each window Component has methods  getX(), getY() for the origin of
the Component and getWidth(), getHeight() for the size. I hope that

Answer #2    Answered By: Laurel Collins     Answered On: Jun 25

You should go to the Rock 'em, sock 'em Robocode! tutorial at:

Its an robot battle simulation engine that you can learn java prorgramming
with and have fun all at the same time.
The site covers everything to get it downloaded and running as well as how
to make your own robot tanks.

Didn't find what you were looking for? Find more on Getting the current frame size Or get search suggestion and latest updates.