Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- do{
- String input_range = JOptionPane.showInputDialog("Įveskite n");
- try{
- range = Integer.parseInt(input_range);
- input = true;
- }catch(NumberFormatException e){
- JOptionPane.showMessageDialog(null,
- "Jūs įvedėte ne skaičių",
- "Perspėjimas",
- JOptionPane.WARNING_MESSAGE);
- input = false;
- }
- if(range < 0){
- JOptionPane.showMessageDialog(null,
- "Jūs įvedėte neigiamą skaičių",
- "Perspėjimas",
- JOptionPane.WARNING_MESSAGE);
- input = false;
- }
- }while(input == false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement