Here is an example:
private void addProductActionPerformed(java.awt.event.ActionEvent evt) {
Products temp=new Products(tfProdName.getText(),Integer.parseInt(txtID.getText()));
products.add(temp);
}
As you can see I have managed to convert the text to integer using:
Integer.parseInt(txtID.getText());
Is it a way to convert the text to float,or I just have to use another container type? If yes,what container should I use?
Any help is highly appreciated!!! :)


Sign In
Create Account


Back to top









