Code example for Choice

Methods: getSelectedItem

0
		public void actionPerformed(ActionEvent e) { 
			URL destURL = null; 
			try { 
				destURL = new URL("http://www.fedex.com/cgi-bin/track_it?" + 
				"&kurrent_airbill=" + numField.getText() + "|" + 
					destChooser.getSelectedItem() + "|" + shipDate + 
					// following boilerplate seems needed 
					"&language=english&cntry_code=us&state=0"); 
			} catch (MalformedURLException err) { 
				System.err.println("Error!\n" + err); 
				showStatus("Error, look in Java Console for details!"); 
			} 
			// debug... 
			System.out.println("URL = " + destURL); 
 
			// "And then a miracle occurs..." 
			FedexTrack.this.getAppletContext().showDocument(destURL); 
		} 
	};