Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > GridLayout or JTable in Java

GridLayout or JTable in Java
Thread Tools
jon_hh_68
Fresh-Faced Recruit
Join Date: Jan 2003
Location: In front of a 12 inch PowerBook
Status: Offline
Reply With Quote
Feb 27, 2003, 07:33 PM
 
I am trying to decide on a strategy for displaying a grid-like array of GUI elements

Each element is a JPanel, and will have various subcomponents which will be updated by other parts of my program.

The elements need to be displayed in 9 x 9 array to the user. At various points columns need to be added to the array. There are also 2 such arrays in the program. Only 1 array will be visible to the user at a time. The arrays also need to be alternatively swapped at various points.

I would like to display the array in a JPanel as part of a larger layout.

Should I use GridLayout and add and remove elements or should I use JTable. I have never used JTable before? Can the elements in a JTable be JPanels?

Thanks,
Jonathan
     
depolitic
Registered User
Join Date: Feb 2003
Status: Offline
Reply With Quote
Feb 28, 2003, 07:51 AM
 
Better to post such a Java Swing quastion on the Apple Java Maling List, far more active I am sure you will find someone with the answer.

http://lists.apple.com/mailman/listinfo/java-dev

Best of luck
     
jon_hh_68  (op)
Fresh-Faced Recruit
Join Date: Jan 2003
Location: In front of a 12 inch PowerBook
Status: Offline
Reply With Quote
Feb 28, 2003, 12:34 PM
 
Thanks for the suggestion. I just did that.

Jonathan
     
jameshays
Fresh-Faced Recruit
Join Date: Mar 2003
Status: Offline
Reply With Quote
Mar 11, 2003, 11:59 PM
 
Also, post it at www.JavaOnUnix.net You should have a good answer shortly.
     
javabeans
Forum Regular
Join Date: Jan 2003
Location: Jersey City, NJ
Status: Offline
Reply With Quote
Mar 18, 2003, 09:18 PM
 
Originally posted by jameshays:
Also, post it at www.JavaOnUnix.net You should have a good answer shortly.
I'd recommend using GridBagLayout since it is very flexible. I'm sure you can probably achieve the same effect using a JTable but I'd image you will have to put in alot more efforts.

Here is a set of tutorials: http://java.sun.com/docs/books/tutorial/uiswing/
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 03:24 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,