client.getMenuBar().setHasTarget( visibleTargets.length > 0 );
      private void cacheVisibleTargets() {        clearVisibleTargets();                Vector vec = client.game.getValidTargets( ce() );        com.sun.java.util.collections.Comparator sortComp = new com.sun.java.util.collections.Comparator() {          public int compare(java.lang.Object x, java.lang.Object y) {            Entity entX = (Entity)x;            Entity entY = (Entity)y;                    int rangeToX = ce().getPosition().distance(entX.getPosition());            int rangeToY = ce().getPosition().distance(entY.getPosition());                    if ( rangeToX == rangeToY ) return ((entX.getId() < entY.getId()) ? -1 : 1);                      return ((rangeToX < rangeToY) ? -1 : 1);          }        };                  com.sun.java.util.collections.TreeSet tree = new com.sun.java.util.collections.TreeSet(sortComp);        visibleTargets = new Entity[vec.size()];                      for ( int i = 0; i < vec.size(); i++ ) {          tree.add((Entity)vec.elementAt(i));          }                com.sun.java.util.collections.Iterator it = tree.iterator();        int count = 0;        while ( it.hasNext() ) {          visibleTargets[count++] = (Entity)it.next();        }        butNextTarg.setEnabled(visibleTargets.length > 0);      }