itemCount = controller.getButtonCount() + controller.getAxisCount() + 2;
values = new JTextField[itemCount];
names = new JTextField[itemCount];
for (int i=0;i<controller.getButtonCount();i++) {
names[i] = new JTextField();
names[i].setEditable(false);
names[i].setBounds(0,i*30,100,30);
names[i].setText(controller.getButtonName(i));
add(names[i]);
values[i] = new JTextField();
values[i].setEditable(false);
values[i].setBounds(100,i*30,100,30);
add(values[i]);
}
for (int i=buttonCount;i<buttonCount+controller.getAxisCount();i++) {
names[i] = new JTextField();
names[i].setEditable(false);
names[i].setBounds(0,i*30,100,30);
names[i].setText(controller.getAxisName(i-buttonCount));
add(names[i]);
values[i] = new JTextField();
values[i].setEditable(false);
values[i].setBounds(100,i*30,100,30);
add(values[i]);
}
int i = itemCount - 2;
names[i] = new JTextField();
names[i].setEditable(false);
names[i].setBounds(0,i*30,100,30);
names[i].setText("POV X");
add(names[i]);
values[i] = new JTextField();
values[i].setEditable(false);
values[i].setBounds(100,i*30,100,30);
add(values[i]);
i = itemCount - 1;
names[i] = new JTextField();
names[i].setEditable(false);
names[i].setBounds(0,i*30,100,30);
names[i].setText("POV Y");
add(names[i]);
values[i] = new JTextField();
values[i].setEditable(false);
values[i].setBounds(100,i*30,100,30);
add(values[i]);
total++;