Currently Having my fields like that:
final JTextField PID = new JTextField("Product ID", 7);
frame.getContentPane().add(PID);
My method:
public StockItem(Long id, String name, String desc, double price) {
this.id = id;
this.name = name;
this.description = desc;
this.price = price;
}
Trying to use this method with values from my JTextField
s, but it does not allow to use JTextField
s under my Long/String/double places.
Is there any way how I could convert my JTextField
s into the required things without editing my Method.