1. public class naloga_1 {
  2. public static void main(String[] args) {
  3. String niz = new String();
  4. int a = 0, b = 0;
  5. try {
  6. niz = javax.swing.JOptionPane.showInputDialog("Vpiši prvo število!");
  7. a = Integer.valueOf(niz).intValue();
  8. niz = javax.swing.JOptionPane.showInputDialog("Vpiši drugo število!");
  9. b = Integer.valueOf(niz).intValue();
  10. } catch(Exception e) {
  11. System.exit(0);
  12. }
  13.  
  14. System.out.println("Manjse stevilo je: " + min(a, b));
  15. System.exit(0);
  16. }
  17.  
  18. private static int min(int x, int y)
  19. {
  20. if(x < y) {
  21. return x;
  22. } else {
  23. return y;
  24. }
  25. }
  26. }