Results 1 to 2 of 2
  1. #1
    Pnev is offline Member
    Join Date
    Nov 2010
    Posts
    1
    Rep Power
    0

    Default Creating An Interactive Grid

    Hello,

    I'm new to the forums, so I apologize in advance for breaking any posting conventions.

    I'm creating a game where I need to be able to display a grid and I need to be able to update what's contained in each cell of the grid frequently. The contents of each cell will either be nothing, or one of two images. I would like to eventually be able to make it so that if the user clicks on a specific cell, I will be able to respond to that click. It would also be ideal if I could drag and drop (from within my program) to each cell.

    I'm not sure what class to use, buttons, content, text boxes etc to populate the grid and any direction would be much appreciated.

    I'm new to GUI's, not new to programming, but so far have created a window, which on a button click closes and opens another window.

    Thanks in advance for any advice!

    -Pnev

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

    Default

    JLabels or JButtons in a container that has a GridLayout, and setIcon(...) to change the image shown, or no image.

    db

Similar Threads

  1. creating a make grid method
    By Matt198525 in forum New To Java
    Replies: 13
    Last Post: 10-29-2010, 02:47 AM
  2. Interactive floorplan
    By teckygamer in forum AWT / Swing
    Replies: 0
    Last Post: 09-06-2010, 12:43 PM
  3. Interactive Panel
    By homistar in forum Java 2D
    Replies: 4
    Last Post: 10-06-2009, 09:16 AM
  4. Help creating a changing grid
    By adlb1300 in forum New To Java
    Replies: 11
    Last Post: 10-24-2007, 01:41 PM
  5. Java Interactive Profiler 1.1 rc 1
    By levent in forum Java Software
    Replies: 0
    Last Post: 06-04-2007, 08:04 AM

Posting Permissions

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