Results 1 to 4 of 4
  1. #1
    imorio is offline Senior Member
    Join Date
    Aug 2010
    Posts
    127
    Rep Power
    0

    Default looking for a layout

    I'm currently making a tower defence game. Visually, this is going to be a "playingfield" where all the action happens and some buttons and textfields etc. below that to give the player some extra options. I'm curently developing the "editor mode" first because it is simpler because it hasn't got moving monsters and shooting tower. Also the game class itself will take in a whole level from the editor (or memory).

    Currently, the editor class makes a 2d-array filled with squares and sends them their location in the grid and their size. Based on that, the squares (a seperate class) calculate which pixels they need to change color and draw a square there. This worked perfectly untill I needed a reset button. Using the borderlayout I added it to south, but it looked bad. So now my question is, can anyone suggest a good layout or help me find a good layout?

    printscreen of the current situation:

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,369
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by imorio View Post
    Using the borderlayout I added it to south, but it looked bad. So now my question is, can anyone suggest a good layout or help me find a good layout?
    Why not stick the functionality in a JMenuItem near the top of that frame (in a JMenuBar)? Or simply as a JButton in a JToolBar (also near the top of the JFrame)?

    kind regards,

    Jos

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    Or, if you want the Reset button at the bottom, add it to a JPanel which has its default FlowLayout, then add that panel to the frame's SOUTH.

    db

  4. #4
    imorio is offline Senior Member
    Join Date
    Aug 2010
    Posts
    127
    Rep Power
    0

    Default

    2 excellent idea's. I think I'm going to do both, put some functions in a menubar at the top and when the game itself is started display that in the bottem.

Similar Threads

  1. JFrame Layout
    By ŖΫ ỏ Ңόρę in forum New To Java
    Replies: 16
    Last Post: 06-16-2010, 01:48 AM
  2. Layout images
    By DarioDep in forum AWT / Swing
    Replies: 2
    Last Post: 05-18-2010, 04:10 PM
  3. Edit layout Layout please help me
    By manhtungtnk28@gmail.com in forum New To Java
    Replies: 4
    Last Post: 11-23-2009, 08:41 AM
  4. Stack layout
    By blue404 in forum SWT / JFace
    Replies: 0
    Last Post: 03-22-2009, 01:15 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
  •