Java Reference
In-Depth Information
L ISTING 7.1 Continued
/**
* It obtains tokens from a string
*/
private String[] getItems(String s){
ArrayList result = new ArrayList();
StringTokenizer st = new StringTokenizer(s,”;:”);
while (st.hasMoreTokens()) {
String w = st.nextToken();
result.add(w);
7
}
String[] a = new String[result.size()];
result.toArray(a);
return a;
}
/**
* Install the application
*/
public void install() {
if (jRadioCustom.isSelected()) {
// the custom option has been chosen
CustomInstallDialog cid = new CustomInstallDialog(this);
cid.setVisible(true);
install(cid.getChosenResources());
} else if (jRadioTypical.isSelected()) {
//
install(typicalInstallationFiles);
} else if (jRadioMinimal.isSelected()) {
//
install(minInstallationFiles);
}
}
/**
* Install the specified set of files
*/
private void install(String[] res) {
if (res == null)
return;
resources = res;
SummaryDialog sd = new SummaryDialog(this);
sd.setVisible(true);
if (!sd.isInstallChoice())
return;
Search WWH ::




Custom Search