I need to create a class that will be used to produce a form which can then be used for user input.
The form won't be used like this it will b part of a GUI.
I know what i want to do but applying all this into code is some what puzzling for me and would very much appreciate some assistance please.
The attributes i would have are:
a GridBagConstraints c1 object for the field labels,
a GridBagConstraints c2 object for the data entry fields.
My method is
I also need another method to make the window visible which i am struggling with.
The form won't be used like this it will b part of a GUI.
I know what i want to do but applying all this into code is some what puzzling for me and would very much appreciate some assistance please.
The attributes i would have are:
a GridBagConstraints c1 object for the field labels,
a GridBagConstraints c2 object for the data entry fields.
My method is
Code:
public void addField(String label, JComponent field) {
form.add(new JLabel(label),c1);
form.add(field,c2);
}
I also need another method to make the window visible which i am struggling with.