Im doing dijkstra algorithms to find short distance
I need help to represent (i) in from text field and (j) in to text field
I and j are 2D an array indices.



import java.applet.*;
import java.awt.*;
import java.awt.event.*;


//declaring class

public class test3 extends Applet implements ActionListener

{ //declaring the TextField

private TextField fromField ,toField;

//declaring an array
int weight[][];

int m = 99; // m is infinity
int N; // Set of Nodes
int d; // distance
int i; // source Node
int j; // destition Node

//declaring values of text field
private int from = i; // start Node
private int to = j; // end node

public void init()

{
setBackground(Color.white);
setForeground(Color.red);
//giving labels
Label TITLE2,TITLE1;
TITLE1 = new Label("from:");
add(TITLE1);
fromField = new TextField(5);
add(fromField);
// register listener using void add actionListener
fromField.addActionListener(this);

TITLE2 = new Label("to");
add(TITLE2);
toField = new TextField(5);
add(toField);
// register listener using void add actionListener
toField.addActionListener(this);


}

// event handler methods
public void actionPerformed(ActionEvent event) {
//declaring textfield
from=Integer.parseInt(fromField.getText());
to=Integer.parseInt(toField.getText());






weight =new int[7][7];
weight[1][1] = 0; weight[2][1]= 2;
weight[1][2]= 2; weight[2][2]= 0;
weight[1][3]= 5; weight[2][3]= 3;
weight[1][4]= 1; weight[2][4]= 2;
weight[1][5]= 99; weight[2][5]= 99;
weight[1][6]= 99; weight[2][6]= 99;


weight[3][1]= 5;
weight[3][2]= 3;
weight[3][3]= 0;
weight[3][4]= 3;
weight[3][5]= 1;
weight[3][6]= 5;


for (int i=1; i<7; ++i) {
for (int j=1; j<7; ++j)

thanks