equal
deleted
inserted
replaced
457 * @param length the length |
457 * @param length the length |
458 * @return the width |
458 * @return the width |
459 */ |
459 */ |
460 public int charsWidth(char[] c, int offset, int length) |
460 public int charsWidth(char[] c, int offset, int length) |
461 { |
461 { |
462 return stringWidth(new String(c, offset, length)); |
462 try |
|
463 { |
|
464 final String string = new String(c, offset, length); |
|
465 return stringWidth(string); |
|
466 }catch (StringIndexOutOfBoundsException ex) |
|
467 { |
|
468 throw new ArrayIndexOutOfBoundsException(); |
|
469 } |
463 } |
470 } |
464 |
471 |
465 /** |
472 /** |
466 * Returns string width in pixels. |
473 * Returns string width in pixels. |
467 * |
474 * |