Results 1 to 4 of 4
Like Tree2Likes
  • 2 Post By CustomException

Thread: 2 quick questions

  1. #1
    krosen11 is offline Member
    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Default 2 quick questions

    Hey, everybody. I'm in AP Computer Science 1, and we have to do a project that requires us to use keys to move an actor around in GridWorld. We also need to maximize the JFrame, but for some reason I can't get it to maximize. So, my questions are:
    1. How do I maximize a JFrame and where in the code do I put it?
    2. How do I get the WASD keys to act as arrow keys and move around the grid?
    I don't have the code with me now, so I can't post what we currently have, but any possible help would be appreciated. Thanks!

  2. #2
    Join Date
    May 2012
    Posts
    18
    Rep Power
    0

    Default Re: 2 quick questions

    Quote Originally Posted by krosen11 View Post
    I don't have the code with me now, so I can't post what we currently have
    No worries, we're in no particular hurry.
    DarrylBurke and JosAH like this.

  3. #3
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,297
    Rep Power
    5

    Default Re: 2 quick questions

    1. How do I maximize a JFrame and where in the code do I put it?
    You'll need to measure the screen first, and then set the size of your frame based on that.

    2. How do I get the WASD keys to act as arrow keys and move around the grid?
    ActionListeners - specifically a KeyListener will do the trick.
    Last edited by quad64bit; 05-21-2012 at 08:08 PM.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    9,928
    Rep Power
    16

    Default Re: 2 quick questions

    Forum Rules -- particularly the third paragraph

    db
    Why do they call it rush hour when nothing moves? - Robin Williams

Similar Threads

  1. Two quick questions
    By smacker in forum New To Java
    Replies: 1
    Last Post: 03-07-2011, 12:11 AM
  2. quick q&a
    By aizen92 in forum New To Java
    Replies: 2
    Last Post: 12-28-2010, 11:55 AM
  3. Quick Help!!
    By MrA in forum New To Java
    Replies: 1
    Last Post: 11-10-2010, 07:38 PM
  4. Quick help
    By locazor in forum New To Java
    Replies: 15
    Last Post: 10-17-2010, 07:07 PM
  5. Couple quick log4j questions
    By lowlyintern in forum New To Java
    Replies: 1
    Last Post: 06-22-2010, 06:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •