I am currently working on a project in which I need to have a textGrid displaying a series of numbers.
I downloaded two textGrid classes that seem unable to allow me to enter text into them, or move around the grids using the keyboard.
I asked a friend of mine who mentioned I should attempt to write my own class, but I have no idea of how to do it properly so that values display correctly.
If anybody is able to either write me a demonstration class or explain how I could go about this endevour, it would be greatly appreciated.
Thanks
That's the problem. I don't have any documentation with them
I can get the textgrid to display in the applet, but it doesn't do what it should i.e it just shows a series of boxes according to my specifications.
I realise that I can possibly clarify what I want better:
I'm looking for some kind of code that will allow me to display a series to editable textareas in this fashion:
_____________
|6|5|3|4|4|0|4|
|7|4|8|9|9|5|6| etc.
I need to be able to move between the individual cells with the keyboard arrow keys and each cell can accomodate a maximum of 2 characters.
So it sounds that you are invoking the textGrid class and can change the rows and columns.
Did you get the code for these classes?
A shot in the dark - there is a method which probably takes row, column, and text or string as arguments. Something such as "writeGrid()" or "addToGrid()" - can you find a method such as this?
Thanks a lot sjalle, this class is just what I need.
I have one or two problems that I can't quite figure out though.
How do I specify the number of rows and columns, is it in a method that I missed somewhere?
And how would I interface the textgrid with a non-applet program? I can't seem to get it to display in a frame or pane. The pane.add() method doesn't seem to take effect.
Also, do the different cells have coordinates that can be displayed and used as variables when the individual cells are accessed?
No, do not mix awt & swing components. Rename all components in my source to
J<name> components (JApplet, JFrame), and change to the <name>.getContentPane().add(<component>)
way of adding components , - where it is required.
Bookmarks