home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / text / StyledEditorKit$UnderlineAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.0 KB  |  24 lines

  1. package javax.swing.text;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import javax.swing.JEditorPane;
  5.  
  6. public class StyledEditorKit$UnderlineAction extends StyledEditorKit.StyledTextAction {
  7.    public StyledEditorKit$UnderlineAction() {
  8.       super("font-underline");
  9.    }
  10.  
  11.    public void actionPerformed(ActionEvent var1) {
  12.       JEditorPane var2 = ((StyledEditorKit.StyledTextAction)this).getEditor(var1);
  13.       if (var2 != null) {
  14.          StyledEditorKit var3 = ((StyledEditorKit.StyledTextAction)this).getStyledEditorKit(var2);
  15.          MutableAttributeSet var4 = var3.getInputAttributes();
  16.          boolean var5 = !StyleConstants.isUnderline(var4);
  17.          SimpleAttributeSet var6 = new SimpleAttributeSet();
  18.          StyleConstants.setUnderline(var6, var5);
  19.          ((StyledEditorKit.StyledTextAction)this).setCharacterAttributes(var2, var6, false);
  20.       }
  21.  
  22.    }
  23. }
  24.