// Beispiel von Seite 102

import javax.swing.*;
public class ggtMitGUI{

  public static void main(String[] args){      
	int x = Integer.parseInt(JOptionPane.showInputDialog("Bitte erste Zahl eingeben"));
	int y = Integer.parseInt(JOptionPane.showInputDialog("Bitte zweite Zahl eingeben"));
	
	String msg = "GGT("+x+","+y+") ist: ";
	
	while (x!=y)
	  if (x>y) x = x-y;
	  else y= y-x;
	  
	JOptionPane.showMessageDialog(null, "GGT("+x+","+y+") ist: " + x);
    }// end of main

}// end of ggtMitGUI  