【发布时间】:2016-06-10 14:23:42
【问题描述】:
//********************************************************************
// Einstein.java Author: Lewis/Loftus
//
// Demonstrates a basic applet.
//********************************************************************
import javax.swing.JApplet;
import java.awt.*;
public class Einstein extends JApplet
{
//-----------------------------------------------------------------
// Draws a quotation by Albert Einstein among some shapes.
//-----------------------------------------------------------------
public void paint (Graphics page)
{
page.drawRect (50, 50, 40, 40); // square
page.drawRect (60, 80, 225, 30); // rectangle
page.drawOval (75, 65, 20, 20); // circle
page.drawLine (35, 60, 100, 120); // line
page.drawString ("Out of clutter, find simplicity.", 110, 70);
page.drawString ("-- Albert Einstein", 130, 100);
}
}
错误:在 Einstein 类中找不到主方法,请将主方法定义为: 公共静态无效主要(字符串 [] 参数) 或者 JavaFX 应用程序类必须扩展 javafx.application.Application
我该如何解决这个问题?
【问题讨论】:
标签: java