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$BeginAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-26  |  2.7 KB  |  26 lines

  1. package com.sun.java.swing.text;
  2.  
  3. import java.awt.event.ActionEvent;
  4.  
  5. class DefaultEditorKit$BeginAction extends TextAction {
  6.    private boolean select;
  7.  
  8.    DefaultEditorKit$BeginAction(String var1, boolean var2) {
  9.       super(var1);
  10.       this.select = var2;
  11.    }
  12.  
  13.    public void actionPerformed(ActionEvent var1) {
  14.       JTextComponent var2 = ((TextAction)this).getTextComponent(var1);
  15.       if (var2 != null) {
  16.          if (this.select) {
  17.             var2.moveCaretPosition(0);
  18.             return;
  19.          }
  20.  
  21.          var2.setCaretPosition(0);
  22.       }
  23.  
  24.    }
  25. }
  26.