【发布时间】:2014-12-06 06:45:45
【问题描述】:
我将我的新类添加到 xcode java 项目创建者的末尾,而 Firefox 说它不支持 Java,因此它不会加载我的任何选项,这些选项的格式可能正确也可能不正确。我确定我应该包括新课程,但有人有什么建议吗?我只研究了基础知识,而我试图用来学习 Java 的网站目前非常有限或技术落后。我尝试将其转换为 HTML,但我认为在线转换器已经过时。有没有办法从 Java 代码生成 HTML,以便我的程序能够渲染一些?
//
// Hovercraft.java
// Hovercraft
//
// Created by Getting Nifty on 12/5/14.
// Copyright (c) 2014 __MyCompanyName__. All rights reserved.
//
// A simple signed Java applet
//
import java.awt.*;
import java.applet.*;
import javax.swing.*;
public class Hovercraft extends JApplet {
static final String message = "Hello World!";
private Font font = new Font("serif", Font.ITALIC + Font.BOLD, 36);
public void init() {
// set the default look and feel
String laf = UIManager.getSystemLookAndFeelClassName();
try {
UIManager.setLookAndFeel(laf);
} catch (UnsupportedLookAndFeelException exc) {
System.err.println ("Warning: UnsupportedLookAndFeel: " + laf);
} catch (Exception exc) {
System.err.println ("Error loading " + laf + ": " + exc);
}
getContentPane().setLayout (null);
}
public void paint (Graphics g) {
super.paint(g);
g.setColor(Color.blue);
g.setFont(font);
g.drawString(message, 40, 80);
}
public class interface int class Hovercraft1 {
forward()
backward()
rotateTo(int angle,booleanimmediateReturn)
stop()
public waitForPress1(Go)
public waitForPress2(Stop)
public waitforPress3(idle)
static drawString(String str, int x, int y)
static shutOff(waitForPress2)
static turnOn(waitForPress1)
static boolean(isMoving)
static boolean(isRunning)
public isStop
public isMoving
public isRunning
public idle
public ProcessVoidStore
static ProcessReturn 3/4 x Null
static ProcessCorrectSlow(
static boolean(isStop)
println.txt Stopping
static boolean(isGo)
status.println(waitForPressn)
rotateTo(int angle,booleanimmediateReturn)
ifClass(isStop)
public class xTurn
public class xTurn2
public class Obstruction
public class RoadDebree(if class Change)
int class Change
int class airPressure
int class Vacuum1Pressure
int class Vacuum2Pressure
int class Vacuum3Pressure
int class Vacuum4Pressure
boolean class Balloon
int class BalloonClose(Balloon%)
int stop args(boolean open Balloon; boolean close Balloon%; vacuum1, vacuum2, vacuum3, vacuum4)
}
【问题讨论】:
-
您可能会更多地阅读该主题并澄清您的问题。我不知道你在说什么
-
HTML5、canvas 等小程序已死。如果真的需要用 Java 写,试试 gwt。
标签: java html firefox render incompatibility