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 那个没法刷新
解决方案 »
- 下了javase7不知道怎么在eclipse里将原先的java6替换掉
- 大侠们推荐几本【java线程/并发】方面的书籍吧
- 关于匿名内部类的问题
- JAVA泛型
- 那里有Sun.Java.Studio.Entreprise.6.0企业版的下载呀???????????
- 急求 java 例子程序代码
- Jni访问java静态成员变量,报JNI WARNING: instance fieldID 0x41620f68 not valid for class
- swing主界面图片的实时更新
- 画出来的图咋看不见罗?请导!
- 哪儿可以下载jbuilder6.0?谢谢!!
- 请教诸位一个maven打包的问题
- java 怎么声明 Tue May 14 09:10:53 CST 2013格式的时间
setLayout(new BorderLayout());
add(new Button("按钮"),BorderLayout.NORTH);