Exemplo n.º 1
0
 public static void main(String[] args) {
   try {
     // The image is loaded either from this
     //   default filename or the first command-
     //   line argument.
     // The second command-line argument specifies
     //   what string will be displayed. The third
     //   specifies at what point in the string the
     //   background color will change.
     String filename = "Raphael.jpg";
     String message = "Java2D";
     int split = 4;
     if (args.length > 0) filename = args[0];
     if (args.length > 1) message = args[1];
     if (args.length > 2) split = Integer.parseInt(args[2]);
     ApplicationFrame f = new ApplicationFrame("ShowOff v1.0");
     f.setLayout(new BorderLayout());
     ShowOff showOff = new ShowOff(filename, message, split);
     f.add(showOff, BorderLayout.CENTER);
     f.setSize(f.getPreferredSize());
     f.center();
     f.setResizable(false);
     f.setVisible(true);
   } catch (Exception e) {
     System.out.println(e);
     System.exit(0);
   }
 }