BlueJ:找不到类CanvasPane

时间:2015-11-21 17:36:50

标签: java bluej

当我尝试在BlueJ中使用类CanvasPane时,它会抛出一个编译错误,说"找不到符号 - 类CanvasPane"即使我添加这些导入:

import javax.swing.*;
import java.awt.*;

可能是什么问题?

1 个答案:

答案 0 :(得分:0)

以下套餐不包含CanvasPane

    import javax.swing.*;
    import java.awt.*;

选中此URLCanvasPaneBlueJ.java中的私有内部类,您无法导入它。否则,您可以定义自己的canvasPane并将其嵌入到您的 public class MyClass{ private CanvasPane myCanvasPane; public class CanvasPane extends JPanel { public void paint(Graphics g) { g.drawImage(canvasImage, 0, 0, null); } } } 中类:

Attempt to unlock a mutex which is locked by another thread