My last answer about using java.util.Calendar
for this was a little more complicated than it needed to be. Here's a simpler version, although it still requires Java 6 or newer.
import java.util.Calendar;
import java.util.Locale;
public class Test
{
public static void main(String[] args)
{
// Sample usage.
// Should be "Apr" in English languages
String month = getMonthNameShort(4);
System.out.println(month);
}
/**
* @param month Month number
* @return The short month name
*/
public static String getMonthNameShort(int month)
{
Calendar cal = Calendar.getInstance();
// Calendar numbers months from 0
cal.set(Calendar.MONTH, month - 1);
return cal.getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.getDefault());
}
}