如何使用pygtk拖动/移动图像?
这是一个有人这样做的视频,但该人没有提供源代码.
我在尝试使HashMap可以访问其所在类中的其他方法时遇到了麻烦.
这基本上是我想要做的,
class object
method main
this.test=9
method fire
output this.test
Run Code Online (Sandbox Code Playgroud)
这是真正的代码
import java.util.*;
import java.lang.String;
import java.util.HashMap;
public class problem {
public HashMap dict;
public problem() {
HashMap<String, String[]> dict = new HashMap<String, String[]>();
// put everything into hashmap
String[] items = { "toys", "sun" };
dict.put("animal", items);
String[] items_2 = { "fun", "games" };
view.put("human", items_2);
this.view = view;
// start
this.BeginM();
}
public void BeginM() {
System.out.println(this.view.get("human")[0]); // should give "fun"
}
}
Run Code Online (Sandbox Code Playgroud)
我在输出阶段得到这个错误:
array required, but …Run Code Online (Sandbox Code Playgroud)