home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 144 / DPCS0200.iso / Internet / Supanet / system / swing.jar / javax / swing / text / DefaultEditorKit$InsertContentAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-05  |  907 b   |  24 lines

  1. package javax.swing.text;
  2.  
  3. import java.awt.Component;
  4. import java.awt.event.ActionEvent;
  5.  
  6. public class DefaultEditorKit$InsertContentAction extends TextAction {
  7.    public DefaultEditorKit$InsertContentAction() {
  8.       super("insert-content");
  9.    }
  10.  
  11.    public void actionPerformed(ActionEvent var1) {
  12.       JTextComponent var2 = ((TextAction)this).getTextComponent(var1);
  13.       if (var2 != null && var1 != null) {
  14.          String var3 = var1.getActionCommand();
  15.          if (var3 != null) {
  16.             var2.replaceSelection(var3);
  17.          } else {
  18.             ((Component)var2).getToolkit().beep();
  19.          }
  20.       }
  21.  
  22.    }
  23. }
  24.