Jump to content
Excelsior Forums

ATBEST

Members
  • Content count

    0
  • Joined

  • Last visited

    Never

Community Reputation

0 Neutral

About ATBEST

  • Rank
    Newbie
  • Birthday 01/01/01
  1. trying to build and package very large java program. runs fine as standalone application, as soon as i try it with JET i get StringIndexOutOfBoundsException : -1 errors which is odd.. Explanation of Code: User types into a text field.. code enables user to use shortcuts, like to enter 1000 user just types 'T' and the smarttextfield converts that to 1000.. this works fine .. but not when built using jet. piece of code is below! if ( evt.getSource() == mQuantityField ) { int quantity = 0; String quantityText = mQuantityField.getText(); if ( !isNumeric( evt.getKeyChar() ) ) { if(isAlpha(evt.getKeyChar())){ String stringQuantity = quantityText.substring( 0, quantityText.lastIndexOf( evt.getKeyChar() ) ); if ( evt.getKeyChar() == 'h' || evt.getKeyChar() == 'H' ) { if ( stringQuantity.length() == 0 ) { stringQuantity = "1"; } quantity = Integer.parseInt( stringQuantity ) * 100; quantityText = String.valueOf( quantity ); } else { if ( evt.getKeyChar() == 't' || evt.getKeyChar() == 'T' ) { if ( stringQuantity.length() == 0 ) { stringQuantity = "1"; } quantity = Integer.parseInt( stringQuantity ) * 1000; quantityText = String.valueOf( quantity ); } else { quantityText = stringQuantity; } } } mInputValues.setQuantity( quantityText ); // Remember the new quantity value mInputValues.fireEvent(); // Tell anyone who cares we have changed something } else { mInputValues.setQuantity( quantityText ); // Remember the new quantity value mInputValues.fireEvent( this ); // Tell anyone who cares we have changed something } }
×