Looking for a good guide.

I was wondering if anybody has a good online guide to help me create a an applet with an invisible 8x8 grid layout. I am aware of the basics but if i could get some good articles, or even be aware of key words to google for, it would be a great help :-)

But honestly, if you know the basics, you'd probably be better off just getting down to business and tweaking some code until you figure out how to make it do what you want!

tim gallagher

Greenhorn

Posts: 4

posted 13 years ago

Stephen,

Firstly, thankyou for your reply :-)

Unfortunately i may have worded my question wrong, so let me rephrase it. When i say "grid layout" i meant, for example, an area of "tiles". I can do this easily with jpanels or buttons for example, but is not what i want (i dont want the edges very visable). i have made an advancement on this.

So far I have written a very small and simple program that creates a line of 8 boxes. I have made only 8 boxes so i can get a very basic version to work (when i say very basic i mean 8 lines cut and paste :-) ).

I can repeat this till i get a screen filled up. Ok.. What i would like to know is this - is it possible to give each rectangle a name (ie an identifier), so that values can be attributed to them? (eg "RECT1", "RECT2" etc)

Example.

"RECTCOLOR" is a value between 1 and 100. It is attributable to all 8 rectangles. Each retangle will have an "if.. else" statement that basically says if "RECTCOLOR" is less than 50, that rectangle color is green, otherwise red.

If this is really simple for you, i would be grateful if you could tell me >>>Can this be done with this method<<< if you could show me it would be great :-) Even keywords to look for in google will be a help. I have been experimenting, and im sure you realise that jave can hard to learn but easy to remember :-)