Java Reference
In-Depth Information
Listing 3-4. The actionPerformed Method for the Exit Button
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
exit();
}
3. Test the application by choosing Build Main Project from the Build menu. When
the build is complete, you can run the application by choosing Run Main Project
from the Run menu. When prompted for the main class, choose WeatherXlet.
Listing 3-5 shows the WeatherXlet class.
Listing 3-5. The WeatherXlet Class
/*
* WeatherXlet.java
*
* Created on November 24, 2007, 6:57 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package com.apress.rischpater.weatherxlet;
import java.awt.Container;
import java.awt.EventQueue;
import javax.microedition.xlet.UnavailableContainerException;
import javax.microedition.xlet.XletContext;
import javax.microedition.xlet.XletStateChangeException;
/**
*
* @author Ray Rischpater
*/
public class WeatherXlet extends javax.swing.JInternalFrame implements
javax.microedition.xlet.Xlet {
private XletContext context; // our Xlet application context.
private Container rootContainer; // the root container of our screen.
 
Search WWH ::




Custom Search