October 2000
Intermediate to advanced
288 pages
5h 45m
English
To complete the system, we'll create a main() routine:
public class Main {
public static void main(String[] args) {
if (args.length == 0) {
System.err.println(
"Arg—file w/tab-delimited author/title/year");
System.exit(1);
}
Searcher searcher = null;
try {
searcher = SearcherFactory.get(args[0]);
} catch (Exception ex) {
System.err.println(
"Unable to open file " + args[0] + "; " + ex);
System.exit(1);
}
SearchPanel sp = new SearchPanel();
sp.setSearcher(searcher);
JFrame display = new JFrame("Bibliographic System—"
+ args[0]);
display.getContentPane().add(sp);
display.setSize(500,500);
display.setVisible(true);
}
}
Read now
Unlock full access