home *** CD-ROM | disk | FTP | other *** search
/ Late Night VRML 2.0 with Java CD-ROM / code.zip / Ch12 / ui / dialogs / NotImpDialog.java < prev    next >
Text File  |  1996-12-31  |  958b  |  56 lines

  1. // VRML Generator
  2. // (c) Justin Couch
  3. //
  4. // From Chapter 13: Late Night VRML 2.0 and Java
  5. //
  6. // Not Implemented Yet warning dialog.
  7.  
  8. package ui.dialogs;
  9.  
  10. import java.awt.*;
  11.  
  12. public class NotImpDialog extends Dialog
  13. {
  14.     Button button;
  15.     Label label;
  16.  
  17.     public NotImpDialog(Frame parent)
  18.     {
  19.         super(parent, "Warning", false);
  20.  
  21.         this.setLayout(new BorderLayout(15, 15));
  22.  
  23.         label = new Label("Warning: " +
  24.           "This feature has not been implemented yet!");
  25.         this.add("Center", label);
  26.  
  27.         // create the OK button in the middle of the dialog
  28.         button = new Button("OK");
  29.         Panel p = new Panel();
  30.  
  31.         p.setLayout(new FlowLayout(FlowLayout.CENTER, 15, 15));
  32.         p.add(button);
  33.  
  34.         this.add("South", p);
  35.  
  36.         // resize to fit
  37.         this.pack();
  38.     }
  39.  
  40.     public boolean action(Event e, Object arg)
  41.     {
  42.         if(e.target == button)
  43.         {
  44.             hide();
  45.             return true;
  46.         }
  47.         else
  48.             return false;
  49.     }
  50.  
  51.     public boolean getFocus(Event e, Object arg)
  52.     {
  53.         button.requestFocus();
  54.         return true;
  55.     }
  56. }