Se c'è una cosa che odio è perdere un sacco di tempo su dei codici che non funzionano sul mio pc... ma "sul manuale" si...

Il software presentato dal manuale è articolato in 3 file distinti che io ho messo dentro un progetto e un package con nomi a piacere.

codice:
package risorse;

import java.util.*;

//Default version (English).
public class SampleRB extends ListResourceBundle {
protected Object[][] getContents() {
 Object[][] resources = new Object[3][2];

 resources[0][0] = "title";
 resources[0][1] = "My Program";

 resources[1][0] = "StopText";
 resources[1][1] = "Stop";

 resources[2][0] = "StartText";
 resources[2][1] = "Start";

 return resources;
}
}
codice:
package risorse;

import java.util.*;

//German version.
public class SampleRB_de extends ListResourceBundle {
protected Object[][] getContents() {
 Object[][] resources = new Object[3][2];

 resources[0][0] = "title";
 resources[0][1] = "Mein Programm";

 resources[1][0] = "StopText";
 resources[1][1] = "Anschlag";

 resources[2][0] = "StartText";
 resources[2][1] = "Anfang";

 return resources;
}
}
codice:
package risorse;

// Demonstrate a resource bundle.
import java.util.*; 

class LRBDemo { 
  public static void main(String args[]) { 
    ResourceBundle rd = ResourceBundle.getBundle("SampleRB");

    System.out.println("English version: ");
    System.out.println("String for Title key : " +
                       rd.getString("title"));

    System.out.println("String for StopText key: " +
                       rd.getString("StopText"));

    System.out.println("String for StartText key: " +
                       rd.getString("StartText"));

    rd = ResourceBundle.getBundle("SampleRB", Locale.GERMAN);

    System.out.println("\nGerman version: ");
    System.out.println("String for Title key : " +
                       rd.getString("title"));

    System.out.println("String for StopText key: " +
                       rd.getString("StopText"));

    System.out.println("String for StartText key: " +
                       rd.getString("StartText"));
  } 
}
l'errore che ottengo è il seguente:

Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name SampleRB, locale it_IT
at java.util.ResourceBundle.throwMissingResourceExcep tion(Unknown Source)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at risorse.LRBDemo.main(LRBDemo.java:8)