有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java试图使用NetBeans Gui生成器在JPanel上绘制点

所以我使用NetBeans拖放功能来创建我的gui

我在框架上拖动了一个Jpanel,并生成了一个鼠标点击事件

private void gardenJPanelMouseClicked(java.awt.event.MouseEvent evt) {                                          

I am not sure what else to add. I have done this before making the gui manually but never with the gui generator.

 public void paintComponent(Graphics g)
    {
        super.paintComponent(g);

        g.setColor(color);
        g.fillRect(0, 0, 1, 1);
    }

  //This does not work
}   

共 (0) 个答案