小编use*_*330的帖子

如何使用pygtk拖动图像

如何使用pygtk拖动/移动图像?

是一个有人这样做的视频,但该人没有提供源代码.

python gtk user-interface pygtk

4
推荐指数
1
解决办法
1648
查看次数

如何从main,java访问变量

我在尝试使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)

java jvm

-1
推荐指数
1
解决办法
335
查看次数

标签 统计

gtk ×1

java ×1

jvm ×1

pygtk ×1

python ×1

user-interface ×1