public void setFields(File propertiesFile){
Properties properties = new Properties();
try{
properties.load(new FileInputStream(propertiesFile));
String isdn = properties.getProperty("ISDN");
String title = properties.getProperty("Title");
String author = properties.getProperty("Author");
String edition = properties.getProperty("Edition");
String year = properties.getProperty("Year");
String price = properties.getProperty("Price");
String comments = properties.getProperty("Comments");
isdnField.setText(isdn);
titleField.setText(title);
authorField.setText(author);
editionField.setText(edition);
yearField.setText(year);
priceField.setText(price);
commentsField.setText(comments);
}catch(FileNotFoundException fnfe){
System.err.println("FileNotFoundException: " + fnfe.getMessage());
}catch(IOException ioe){
System.err.println("IOException: " + ioe.getMessage());
}
}
import edu.stanford.ejalbert.BrowserLauncher.*;
import java.io.*;
import java.net.*;
public class Launcher {
public static void main(String[] args){
Launcher launcher = new Launcher();
launcher.init();
}
public void init(){
try{
edu.stanford.ejalbert.BrowserLauncher.openURL("http://http://www.artima.com/");
}catch(IOException ioe){
System.err.println("IOException: " + ioe.getMessage());
}
}
}