home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161a.iso / handson / files / copyjava.exe / com / sun / java / swing / text / DefaultEditorKit$InsertContentAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-26  |  2.9 KB  |  25 lines

  1. package com.sun.java.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.             return;
  18.          }
  19.  
  20.          ((Component)var2).getToolkit().beep();
  21.       }
  22.  
  23.    }
  24. }
  25.