I am attempting to make a TicTacToe in java using Swing. Instead of using buttons for mark(x and o) placing on 3x3 grid, i used textfield(variable name- pos) to specify position of mark entering and another textfield(var name- val) to take value to insert it into the position which i got from the first textfield.
The problem i am facing is that when i write
pos.getText();
i get a string value from it. But how do i get actual position name from string and set the "val" in it??
eg:- if a position on the field is a1, then we write a1 in pos textField. But if i getText from pos, how do i get a1 as in its control name in swing and not the actual string.
I hope i am clear.
Pls help.