import java.applet.Applet;
import java.awt.*;
// Applet code for the "Hello, world!" example.
// This should be saved in a file named as "HelloWorld.java".
public class HelloWorld extends Applet {
// This method is mandatory, but can be empty (i.e., have no actual code).
public void init() { }
// This method is mandatory, but can be empty.(i.e.,have no actual code).
public void stop() { }
// Print a message on the screen (x=20, y=10).
public void paint(Graphics g) {
g.drawString("Hello, world!", 20,10);
// Draws a circle on the screen (x=40, y=30).
g.drawArc(40,30,20,20,0,360);
}
} g.drawString("Hello, world!", 20,10);
那我想写个button或者jpanel进去呢?不用japplet 那个没法刷新
import java.awt.*;
// Applet code for the "Hello, world!" example.
// This should be saved in a file named as "HelloWorld.java".
public class HelloWorld extends Applet {
// This method is mandatory, but can be empty (i.e., have no actual code).
public void init() { }
// This method is mandatory, but can be empty.(i.e.,have no actual code).
public void stop() { }
// Print a message on the screen (x=20, y=10).
public void paint(Graphics g) {
g.drawString("Hello, world!", 20,10);
// Draws a circle on the screen (x=40, y=30).
g.drawArc(40,30,20,20,0,360);
}
} g.drawString("Hello, world!", 20,10);
那我想写个button或者jpanel进去呢?不用japplet 那个没法刷新
解决方案 »
- 基础的问题,,看看我错在哪里
- yield()为什么不能抛出InterruptedException异常??
- 有java API chm格式中文版本的进来啊
- finally的神秘问题
- 为什么在借口的方法定义中不能使用setLable() ?
- 关于sqlserver2k连接jbuilder9的问题,急~~~~,请各位大虾帮忙解决呀~~~~谢谢了~~~
- 如何使用Java自带的正则表达式?
- 一个急死人的问题,但可能很简单,快来拿分
- 启动weblogic的时候提示java.lang.UnsatisfiedLinkError:no muxer in java.library.path错误。这是什么错误?
- 关于applet的问题
- 请教诸位一个maven打包的问题
- java 怎么声明 Tue May 14 09:10:53 CST 2013格式的时间
setLayout(new BorderLayout());
add(new Button("按钮"),BorderLayout.NORTH);