2016-12-16 50 views
1

我想在Minecraft中創建一個hack客戶端,但它在Eclipse中給我一個錯誤。把ULocale不適用於參數

在它強調在這個「放」的代碼:

categoryFrames.put(module.getCategory(), frame); 

這是崩潰報告

Unexpected error

java.lang.Error: Unresolved compilation problem: The method put(ULocale.Category, GuiManager.ModuleFrame) in the type Map is not applicable for the arguments (Category, GuiManager.ModuleFrame)

我該怎麼處理這件事?

回答

0

這意味着您提供的參數不是正確的類型。當你宣佈你HashMap,你可以這樣做以下方式:

HashMap<String, Object> myHashMap = new HashMap<String, Object>(); 

看看你的地圖對象的聲明,並看看預期的類型。這會帶你大部分的方式。

如果你想讓我們看看你將不得不編輯你的問題,並在你的問題中包含hashmap的聲明。包含所有代碼會更好。更好的方法是檢查wiki如何在SO和here is the link to that resource上提問。