Java Reference
In-Depth Information
transitions to the controller. To create the controller class and hook it to the buttons,
follow these steps:
1. Add the Java class WeatherController to the package (right-click the Source
Packages item and choose New Java Class). Change its contents to read as shown
in Listing 3-7. While you're there, you should change the package name, too.
Listing 3-7. The WeatherController Class
/*
* WeatherController.java
*
* Created on November 24, 2007, 8:03 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package com.apress.rischpater.weatherxlet;
import javax.swing.JPanel;
import org.jdesktop.layout.GroupLayout;
/**
*
* @author Ray Rischpater
*/
public class WeatherController {
private JPanel mainPanel, settingPanel;
WeatherXlet xlet;
GroupLayout layout;
/** Creates a new instance of WeatherController */
public WeatherController( WeatherXlet x) {
xlet = x;
layout = (GroupLayout)xlet.getContentPane().getLayout();
}
public void setMainPanel( JPanel m ) {
mainPanel = m;
}
 
Search WWH ::




Custom Search