by the great wind i come
BlogJava
首頁
新隨筆
新文章
聯系
聚合
管理
posts - 6,comments - 1,trackbacks - 0
<
2025年6月
>
日
一
二
三
四
五
六
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
(3)
給我留言
查看公開留言
查看私人留言
隨筆分類
(5)
時尚科技(4)
隨風心情(1)
隨筆檔案
(6)
2005年8月 (5)
2005年7月 (1)
文章分類
(2)
Java Applet 編程(1)
Java GUI 編程(1)
文章檔案
(2)
2005年7月 (2)
Blog
【刻錄事】
94smart
Delphi公園
Webleon
對牛亂彈琴 | Playin' with IT
布魯斯狼
魚魚愛歌會
Link
del.icio.us
gmail
google-me
wallop
zh-wiki
flick
r
最新評論
1.?re: JFrame 類的用法
很好,怎樣往窗口內容區(qū)加內容?請給出語句。謝謝!!!!!!!!!
--miao
閱讀排行榜
1.?swing組件的用法(1086)
2.?Just for fun(573)
3.?重返c++總部(411)
4.?全flash制作的webmail(398)
5.?Google的IM推出了(383)
評論排行榜
1.?Google的IM推出了(0)
2.?全flash制作的webmail(0)
3.?好玩的東東(0)
4.?重返c++總部(0)
5.?Just for fun(0)
Java Applet小事例
這個Applet是用來在網頁上顯示一個Button.用到JApplet類
import java.awt.
*
;
import java.awt.
event
.
*
;
import java.net.
*
;
import java.applet.
*
;
import javax.swing.
*
;
public
class
SwingApplet extends JApplet
{
JButton button;
public
void
init()
{
String laf
=
UIManager.getSystemLookAndFeelClassName();
try
{
UIManager.setLookAndFeel(laf);
//
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
}
catch
(UnsupportedLookAndFeelException exc)
{
System.err.println(
"
Warning: UnsupportedLookAndFeel:
"
+
laf);
}
catch
(Exception exc)
{
System.err.println(
"
Error loading
"
+
laf
+
"
:
"
+
exc);
}
getContentPane().setLayout(
new
FlowLayout());
button
=
new
JButton(
"
Hello, I'm a Swing Button!
"
);
getContentPane().add(button);
}
public
void
stop()
{
if
(button
!=
null
)
{
getContentPane().remove(button);
button
=
null
;
}
}
}
posted on 2005-07-19 11:20
linchanx
閱讀(335)
評論(0)
編輯
收藏
所屬分類:
Java Applet 編程
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發(fā)表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Copyright ©2025 linchanx Powered By
博客園
模板提供:
滬江博客
主站蜘蛛池模板:
建平县
|
盐边县
|
平阴县
|
习水县
|
财经
|
内江市
|
丹东市
|
浏阳市
|
房产
|
乌拉特后旗
|
钟山县
|
永川市
|
天等县
|
温宿县
|
西乡县
|
门源
|
武山县
|
灵丘县
|
固原市
|
岐山县
|
屏山县
|
永丰县
|
左云县
|
汉源县
|
苏尼特右旗
|
赤峰市
|
简阳市
|
原平市
|
乐安县
|
和静县
|
苏尼特右旗
|
远安县
|
民勤县
|
铁岭县
|
长丰县
|
龙口市
|
抚州市
|
宁国市
|
齐齐哈尔市
|
许昌市
|
兰西县
|