In the following code I have created 3 variables:
public class tuna extends JFrame {
//Creating 3 text fields
private JTextField item1;
private JTextField item2;
private JTextField item3;
what I dont understand is why I then need to do the following:
item1=new JTextField(10);
add(item1);
Why is it necessary to declare item1 as a jtextfield again? Is it solely to create its size and text etc?