Java Reference
In-Depth Information
Figure C-1.
Setting the -profile option for the Java compiler in the NetBeans IDE for a Java project
If the Java source code uses Java SE APIs outside the specified profile, the
javac
command generates an error.
Consider the code for the
SwingTest
and
RowSetTest
classes as shown in Listing C-1 and Listing C-2, respectively.
Listing C-1.
A SwingTest Class That Uses a Class from the javax.swing Package
// SwingTest.java
package com.jdojo.profiles;
import javax.swing.JFrame;
public class SwingTest {
public static void main(String[] args) {
JFrame frame = new JFrame("Compact Profiles");
frame.setSize(300, 300);
frame.setVisible(true);
}
}