Source

import java.net.*;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;

public class Weather extends JFrame implements ActionListener {
   JTextArea text;
   JComboBox locale = null;
   JButton start;
   String url = "http://weather.noaa.gov/pub/data/observations/metar/decoded";

   public void init () {
      setLayout(new BorderLayout());
      setBackground(new Color(255,255,224));

      add("Center", new JScrollPane(text = new JTextArea()));

      JPanel p = new JPanel();
      p.setLayout(new FlowLayout());
      p.setBackground(new Color(255,255,224));
      p.add(start = new JButton("Fetch"));
      p.add(new JLabel("  "));
      p.add(locale = new JComboBox());
      add("South", p);

      start.addActionListener(this);
      start.setFont(new Font("TimesRoman", Font.PLAIN, 18));

      locale.addItem("KCVG (Cincinnati)");
      locale.addItem("KLUK (Cincinnati)");
      locale.addItem("KHAO (Hamilton)");
      locale.addItem("KDAY (Dayton)");
      locale.addItem("KBWI (Baltimore)");
      locale.addItem("KFME (Fort Meade)");
      locale.addItem("KPIT (Pittsburgh)");
      locale.addItem("KOAK (Oakland)");
      locale.addItem("KCLE (Cleveland)");
      locale.addItem("KZZV (Zanesville)");
      locale.addItem("KCMH (Columbus)");
      locale.addItem("KORD (Chicago, O'Hare)");
      locale.addItem("KDPA (Chicago, Du Page)");
      locale.addItem("KPWA (Chicago, Wheeling)");
      locale.addItem("KNYC (New York)");
      locale.addItem("KSFO (San Francisco)");
      locale.addItem("KLAX (Los Angeles)");
      locale.addItem("SBRJ (Rio De Janeiro)");
      locale.addItem("EGLL (London)");
      locale.addItem("LFPB (Paris)");
      locale.addItem("LIRF (Rome)");
      locale.addItem("EDDM (Muenchen)");
      locale.addItem("KQTZ (Baghdad)");
      locale.addItem("UUDD (Moscow)");
      locale.addItem("UTSB (Uzbekistan)");
      locale.addItem("ZGGG (Guangzhou)");
      locale.addItem("VIDP (Delhi)");
      locale.addItem("YSSY (Sydney)");
      locale.addItem("NZAA (Auckland)");
      locale.addItem("NZSP (Antartica)");
      locale.addItem("NVVV (Vanuatu)");
      locale.setFont(new Font("TimesRoman", Font.PLAIN, 18));

      setSize(700,300);
      setVisible(true);
   }

   public void actionPerformed (ActionEvent evt) {
      text.setText("");
      String [] place = ((String)locale.getSelectedItem()).split(" ");
      String line;

      try {
	 URL weather = new URL(url+"/"+place[0]+".TXT");
	 InputStream is = (InputStream)weather.getContent();
         InputStreamReader isr = new InputStreamReader(is);
         BufferedReader bis = new BufferedReader(isr);
	 while ((line = bis.readLine()) != null) {
	    text.append(line+"\n");
	    int l = text.getDocument().getLength();
	    text.setCaretPosition(l);
	 }
      } catch (Exception e) {
	 text.append(e.toString());
      }
   }
}