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

    Default Creating An Interactive Grid


    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!


  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power


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


Similar Threads

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