tags:

views:

165

answers:

1

How do I format my string in GWT?

I made a method

  Formatter format = new Formatter();
    int matches = 0;
    Formatter formattedString = format.format("%d numbers(s, args) in correct position", matches);
    return formattedString.toString();

But it complains by saying

Validating newly compiled units
   [ERROR] Errors in 'file:/C:/Documents%20and%20Settings/kkshetri/workspace/MasterMind/MasterMind/src/com/kunjan/MasterMind/client/MasterMind.java'
      [ERROR] Line 84: No source code is available for type java.util.Formatter; did you forget to inherit a required module?

Isn't Formatter included?

+2  A: 

Looks like formatter isn't included according to this post. However, they suggest some alternatives.

Pace
Worth mentioning are also `NumberFormat` and `DateTimeFormat`.
Igor Klimer