Java Reference
In-Depth Information
L ISTING 12.6
Continued
}
}//-for
return true;
}
}
From Listing 12.6, we can see how the contains() method (see lines 60-77) performs all the
needed operations to test whether a given version-id is contained.
12
Finally, we can see the Test class in Listing 12.7. This class is useful for testing interactively
version definitions, as represented in JNLP.
L ISTING 12.7
The Test Class
package com.marinilli.b2.c12;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/**
* Chapter 12 - A version test class
*
* @author Mauro Marinilli
* @version 1.0
*/
public class Test extends JFrame {
JPanel jPanel2 = new JPanel();
JPanel jPanel1 = new JPanel();
FlowLayout flowLayout1 = new FlowLayout();
JLabel jLabel1 = new JLabel();
JTextField versionStringTextField = new JTextField(12);
JLabel jLabel2 = new JLabel();
JTextField versionIdTextField = new JTextField(8);
JPanel jPanel3 = new JPanel();
JButton matchButton = new JButton();
JLabel outcomeLabel = new JLabel();
public Test() {
getContentPane().setLayout(flowLayout1);
jLabel1.setText(“VersionString”);
jLabel2.setText(“VersionId”);
matchButton.setText(“match”);
Search WWH ::




Custom Search