下面的JAVA程序有什么问题?各位编程大哥帮帮忙
//MyPaint.javapackagetest.paint;importjavax.swing.*;classMyPaint{publicstaticfinalint...
//MyPaint.java
package test.paint;
import javax.swing.*;
class MyPaint
{
public static final int WIDTH=600;
public static final int HEIGHT=400;
JFrame mainFrame;
public void showPaint()
{
mainFrame=new JFrame();
mainFrame.setTitle("");
mainFrame.setSize(WIDTH,HEIGHT);
mainFrame.setResizable(false);
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.show();
}
}
//TextMyPaint.java
import test.paint.MyPaint;
public class TestMyPaint
{
public static void main(String[] args)
{
MyPaint testPaint =new MyPaint();
testPaint.showPaint();
}
} 展开
package test.paint;
import javax.swing.*;
class MyPaint
{
public static final int WIDTH=600;
public static final int HEIGHT=400;
JFrame mainFrame;
public void showPaint()
{
mainFrame=new JFrame();
mainFrame.setTitle("");
mainFrame.setSize(WIDTH,HEIGHT);
mainFrame.setResizable(false);
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.show();
}
}
//TextMyPaint.java
import test.paint.MyPaint;
public class TestMyPaint
{
public static void main(String[] args)
{
MyPaint testPaint =new MyPaint();
testPaint.showPaint();
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询