home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 144 / DPCS0200.iso / Internet / Supanet / system / swing.jar / javax / swing / plaf / basic / BasicTableUI$FocusHandler.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-05  |  1.2 KB  |  40 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 BasicTableUI$FocusHandler implements FocusListener {
  8.    // $FF: synthetic field
  9.    private final BasicTableUI this$0;
  10.  
  11.    public BasicTableUI$FocusHandler(BasicTableUI var1) {
  12.       this.this$0 = var1;
  13.    }
  14.  
  15.    public void focusGained(FocusEvent var1) {
  16.       if (this.this$0.table.getRowCount() > 0) {
  17.          if (this.this$0.table.getSelectedColumn() == -1) {
  18.             this.this$0.table.setColumnSelectionInterval(0, 0);
  19.          }
  20.  
  21.          if (this.this$0.table.getSelectedRow() == -1) {
  22.             this.this$0.table.setRowSelectionInterval(0, 0);
  23.          }
  24.  
  25.          this.repaintAnchorCell();
  26.       }
  27.    }
  28.  
  29.    public void focusLost(FocusEvent var1) {
  30.       this.repaintAnchorCell();
  31.    }
  32.  
  33.    private void repaintAnchorCell() {
  34.       int var1 = this.this$0.table.getSelectedRow();
  35.       int var2 = this.this$0.table.getSelectedColumn();
  36.       Rectangle var3 = this.this$0.table.getCellRect(var1, var2, false);
  37.       this.this$0.table.repaint(var3);
  38.    }
  39. }
  40.