i'm new to java and i'm trying to make number sequence with one TextArea and one Button, using '\n' and '\t'
the result should look like this:
1 1 1
2 3 4
3 5 9
. . .
. . .
. . .
15 29 225
i got the first two columns but i need help with the third
import java.applet.Applet; import java.awt.*; public class talnarod extends Applet { TextArea Ttafla; Button Bstart; int i, a, b, c; public void init() { Bstart = new Button("Start"); Ttafla = new TextArea(15,25); this.add(Bstart); this.add(Ttafla); } public boolean action(Event e, Object o) { if (e.target == Bstart) { for (a=1; a <= 15; a++) //here i set the length of the sequence 1 to 15 { b = a+a-1; //odd numbers for second column c = 1; //and here i need help !!! Ttafla.appendText("" + a + '\t' + b + '\t' + c + '\n'); } return true; } return false; } }