|
|
@@ -89,10 +89,13 @@ public class VisitorsDialogPanel extends JDialog{
|
|
|
|
|
|
private void save(){
|
|
|
if(this.visitorstextfield.getText().equals("")){
|
|
|
- JOptionPane.showMessageDialog(null, "Visitors can't be empty!", "Warning", JOptionPane.WARNING_MESSAGE);
|
|
|
+ JOptionPane.showMessageDialog(null, "Visitors can't be empty!", "Warning", JOptionPane.WARNING_MESSAGE);
|
|
|
return;
|
|
|
}else{
|
|
|
int visitors = Integer.parseInt(this.visitorstextfield.getText());
|
|
|
+ if(visitors <0){
|
|
|
+ JOptionPane.showMessageDialog(null, "Visitors can't be less than 0!", "Warning", JOptionPane.WARNING_MESSAGE);
|
|
|
+ }
|
|
|
terrain.setMaxVisitors(visitors);
|
|
|
dispose();
|
|
|
}
|