import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.util.Hashtable;
import java.applet.Applet;

public class internetsitesecici extends Applet 
implements ItemListener
{
  private Hashtable site;
  private Choice siteChoice;
  public void init()
  {
  site=new Hashtable();
  siteChoice=new Choice();
  String baslik,yer;
  URL url;
  int counter=0;
  try
  {
  baslik="TUBITAK Marmara Arastirma Merkezi";
  yer="http://www.mam.gov.tr";
  url=new URL(yer);
  site.put(baslik,url);
  siteChoice.add(baslik);
  baslik="Turhan Coban";
  yer="http://www.mam.gov.tr/~turhan";
  url=new URL(yer);
  site.put(baslik,url);
  siteChoice.add(baslik);
  baslik="TUBITAK Marmara Arastýrma Merkezi network sitesi";
  yer="http://www.mam.net.tr";
  url=new URL(yer);
  site.put(baslik,url);
  siteChoice.add(baslik); 
  baslik="Java sitesi";
  yer="http://java.sun.com";
  url=new URL(yer);
  site.put(baslik,url);
  siteChoice.add(baslik);   
  }
  catch(MalformedURLException e){e.printStackTrace();}  
 
  add(new Label("internet sitesi seciniz:"));
  siteChoice.addItemListener(this);
  add(siteChoice); 
  }
  public void itemStateChanged(ItemEvent e)
  {
    URL url=(URL)site.get(e.getItem());

    getAppletContext().showDocument(url);
  } 
}
