just to let you know that i have got it working now as i want it to. thanks again. I do have another query though (you'd never guess id ask you a question lol). A week ago you mentioned you would show me how to create a grid of JTextAreas using a loop (so i dont have to type out many lines that could slow the program). Well that has been todays task and i am finding it complicated.
As far as i can see, i use a nested loop to go through the grid which has been previously defined. if the grid[row][col] being checked is empty, then a reference of a JTextArea is added. However, im not sure how to use the loop to set dimensions or XYConstraints, and also to create it in a specfic JPanel. I managed earlier to get some code with no errors that supposedly created JTextAreas in a grid yet nothing happend. Everything seems to boil down to manually creating the JTextAreas and constraints ( i gave up after 200 as the computer froze - jbuilder was using 486mb ram ).
its quite frustrating as i have alot of algorithms working in a smaller grid, but i need bigger grids ( 8x8 is not suffice ). Are you able to explain to me how i would go about this? Please note that i have looked up 2 books on such things as layouts, and am currently at the sun website on layout managers, but they only show simplistic areas like arranging 6 different size objects in a frame, which i can do. I have also been looking up TicTacTie, Chess and Battleships source code.
Basically there are two swing containers (JPanels - West and East) and i would like West filled with 20x20 grid of JTextAreas. (West is actually a JPanel within a ScrollPanel. Maybe you detail the basics, then i have a go to see what i can do , then any problems i post code? If you know of any webpages or articles that deal specifally with this problem ( using a loop to make a grid ) that is also fine - i just need something to work on as im stuck.
Again, the only method i have got to work is this.
1) Create grid[row][col] max.
2) Create 400 textarea manually
3) Create 400 textarea dimensions manually
4) Create 400 textarea xtconstraints manually
5) give each grid position one of the textareas manually.
( thats at least 1600 lines of code, probably followed by a computer crash, and probably followed with alot of swearing
thankyuo for reading,
p.s my last effort is this;
it produces no errors.
nothing happens when the program is run.
[ February 28, 2005: Message edited by: joseph mcgratton ]