ResourceBundle to Hashtable

mury

Grünschnabel
Hi,
bin newbie in sachen Java.

habe gerade ein Problem.. hier ein bissle code

Code:
public static void main(String[] args)
{
Hashtable<String, String> h1 = new Hashtable<String, String>();
Hashtable<String, String> h2 = new Hashtable<String, String>();
Hashtable<String, String> h3 = null;
		

//Hashtable befüllen h1
h1.put("AxBxyCy", "123");
h1.put("XaYb", "73");

//Hashtable befüllen h2
//h2.put("ABC", "AxBxyCy");
//h2.put("XY", "XaYb");
		
//Resourcebundle
String baseName="Test";    //die daten sind hier gelistet z.b ABC=xyz
  try
	{
	ResourceBundle bundle = ResourceBundle.getBundle(baseName);
	System.out.println (bundle.getString("ABC"));
	Hashtable<String, String> bundleMap = new Hashtable<String, String>();
			
	for (Iterator iter = bundle.keySet().iterator(); iter.hasNext();) {
	String key = (String)iter.next();
	 bundleMap.put(key, bundle.getString(key));
			}

			
h3= Hashmethode.xmethode(h1, bundleMap);

			System.out.println(h3);
		}
		catch (MissingResourceException e) {
			System.err.println("String nicht vorhanden");
		}
		
		


		

	}
}
fehler hier..er findet das keySet nicht.
The method keySet() is undefined for the type ResourceBundle

was kann ich als alternative nehmen?
 
Zurück