javauis/lcdui_qt/src/javax/microedition/lcdui/Font.java
changeset 35 85266cc22c7f
parent 23 98ccebc37403
child 80 d6dafc5d983f
equal deleted inserted replaced
26:dc7c549001d5 35:85266cc22c7f
   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      *