O'Reilly logo

Extreme Programming Installed by Chet Hendrickson, Ann Anderson, Ron Jeffries

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Main

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);
      }
   }

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required