home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 144 / DPCS0200.iso / Internet / Supanet / system / swing.jar / javax / swing / plaf / basic / BasicListUI$FocusHandler.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-05  |  1.1 KB  |  34 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.Rectangle;
  4. import java.awt.event.FocusEvent;
  5. import java.awt.event.FocusListener;
  6.  
  7. public class BasicListUI$FocusHandler implements FocusListener {
  8.    // $FF: synthetic field
  9.    private final BasicListUI this$0;
  10.  
  11.    public BasicListUI$FocusHandler(BasicListUI var1) {
  12.       this.this$0 = var1;
  13.    }
  14.  
  15.    public void focusGained(FocusEvent var1) {
  16.       this.repaintCellFocus();
  17.    }
  18.  
  19.    public void focusLost(FocusEvent var1) {
  20.       this.repaintCellFocus();
  21.    }
  22.  
  23.    protected void repaintCellFocus() {
  24.       int var1 = this.this$0.list.getLeadSelectionIndex();
  25.       if (var1 != -1) {
  26.          Rectangle var2 = this.this$0.getCellBounds(this.this$0.list, var1, var1);
  27.          if (var2 != null) {
  28.             this.this$0.list.repaint(var2.x, var2.y, var2.width, var2.height);
  29.          }
  30.       }
  31.  
  32.    }
  33. }
  34.