Results 1 to 5 of 5
  1. #1
    samanyu is offline Member
    Join Date
    Jun 2011
    Location
    Tsukuba, Japan
    Posts
    63
    Rep Power
    0

    Default displaying multiple grids in a window

    Hi all,
    I have accepted certain integer values into a 3-D array. Each 2-D array is basically a grid of cells, and there are say 'n' 2-D arrays in my 3-D array. After accepting data from the user, and storing it in the 2-D array, I now need to display the 3-D array in a window.

    To make it clearer, I need to display all 'n' 2-D arrays in a window while the program is running simultaneously so the user can view his input.

    It may be like multiple images on a JScrollPane, I'm just guessing, I don't know, I'm new to Java, and haven't really tried everything. The grids are not images, I have displayed them using paintComponent and fillRect.
    Some help will be appreciated!

  2. #2
    samanyu is offline Member
    Join Date
    Jun 2011
    Location
    Tsukuba, Japan
    Posts
    63
    Rep Power
    0

    Default

    C'mon, help a brother out!!

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    I'm not clear on exactly what you're looking for. Perhaps you want to display a couple of JTables each held in a tab of a JTabbedPane, or perhaps not. You may want to give us more information on what you're trying to achieve, what this GUi should look like, more about the information it holds and what the user will do with this information.

    Also, this forum is staffed by volunteers, so please don't bump your thread sooner than 12-24 hours after posting if you don't want to appear impatient. Otherwise if you're in a super big hurry, consider checking out a pay-for-help site.

    Luck.

  4. #4
    samanyu is offline Member
    Join Date
    Jun 2011
    Location
    Tsukuba, Japan
    Posts
    63
    Rep Power
    0

    Default

    Is there some way i can convert a collection/grid of squares on a JPanel into an image? And then display many such images in one JPanel? There will be no further input from the user, its simply to be able to see the existing data at all times.

  5. #5
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,574
    Rep Power
    12

    Default

    I don't see the point of creating images. Just display each "plane" in a table and make it read only. Then apply a box layout to a panel and add the tables to it as the user finishes entering the data for each. (You could use a single table and just append rows to it - this would be a simple way of ensureing that the columns lined up)

    Since there is only a certain amount of screen realestate, unless your 2d arrays are really small you may want to supply the user with a control (combobox, slider etc) so they can move from plane to plane.

Similar Threads

  1. Displaying multiple images
    By asmitarnd in forum AWT / Swing
    Replies: 2
    Last Post: 04-19-2011, 01:14 PM
  2. JFrame(window) not displaying at all
    By mojisolaowoeye in forum AWT / Swing
    Replies: 1
    Last Post: 07-02-2010, 02:03 PM
  3. Replies: 0
    Last Post: 11-28-2009, 04:37 AM
  4. Replies: 3
    Last Post: 10-12-2009, 03:03 PM
  5. Multiple window
    By shoeb83 in forum New To Java
    Replies: 1
    Last Post: 08-30-2009, 11:59 PM

Tags for this Thread

Posting Permissions

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