Java Swing Dialog need help!?

peter m

New member
Ok i got this bit of code

if (Output_Capacity_TextField.getText().compareTo ("") < 100)
{JOptionPane.showMessageDialog (null,
"Error: Output Capacity must be larger than 100!",
"Error!", JOptionPane.ERROR_MESSAGE);
But when i type a number above 100 in the textfield specified it still shows the error message????
please help
I am using textpad 5
 
The type returned from myTextField.getText() will be String

if( ! Output_Capacity_TextField
.getText()
.isEmpty() ) {
if( Integer
.parseInt( Output_Capacity_TextField
.getText() ) < 100 ) {
JOptionPane.showMessageDialog( null, "gotta have 100+, cowboy );
}
else {
int x = Integer.parseInt( Output_Capacity_TextField
.getText() ) + 0;
}
}
 
Back
Top