Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 出来乍到,请问怎么样把代码放到黑板中
micsolaris





发贴: 36
积分: 5
于 2008-09-12 01:06 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我见这论坛中很多人发的代码都放都黑板中,请问要怎么做才可以啊


作者 Re:出来乍到,请问怎么样把代码放到黑板中 [Re:micsolaris]
JiafanZhou



版主


发贴: 736
积分: 61
于 2008-09-12 16:18 user profilesend a private message to usersend email to JiafanZhousearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Have a look at the "Jute标记", makes text nonproportional with fixed-width font


When I was a kid I used to pray every night for a new bike. Then I realized that The Lord doesn't work that way, so I stole one and asked him to forgive me.
作者 Re:出来乍到,请问怎么样把代码放到黑板中 [Re:micsolaris]
xuxiaolei

^_^



发贴: 169
积分: 23
于 2008-09-12 16:20 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
快速回复下面不是有个Jute标记吗,点击,会出来一个窗口,复制code标签,然后让你的代码替换code标签中的text就可以了


http://xuxiaolei.javaeye.com
作者 Re:出来乍到,请问怎么样把代码放到黑板中 [Re:micsolaris]
jancyu2008





发贴: 36
积分: 0
于 2008-09-15 00:11 user profilesend a private message to usersend email to jancyu2008search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
[code]标签里面放你要放的东西

jancyu2008 edited on 2008-09-15 00:14

Every day thinking about JAVA, because I like to
Welcome to My pagehttp://jeakylau.51.com
My E-mail:jeakylau@126.com
My QQ : 529163539
作者 Re:出来乍到,请问怎么样把代码放到黑板中 [Re:micsolaris]
micsolaris





发贴: 36
积分: 5
于 2008-09-15 02:28 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
谢谢各位热心的朋友


作者 Re:出来乍到,请问怎么样把代码放到黑板中 [Re:micsolaris]
shingoyj





发贴: 1
积分: 0
于 2008-10-29 13:16 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
import java.awt.BorderLayout;
import java.awt.Container;
import java.util.Date;
import javax.swing.JButton;
import javax.swing.JFrame;

class MyFrame extends JFrame {
JButton timeButton;

public MyFrame() {
setSize(400, 200);
setEnabled(true);
setTitle("时间表");
Container container = getContentPane();
timeButton = new JButton();
container.add(timeButton, BorderLayout.CENTER);
setVisible(true);

String timeStr;
String year;
String month;
String day;
String hour;
String minute;
String second;
while (true) {
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Date date = new Date();
year = String.valueOf(date.getYear() + 1900);
month = String.valueOf(date.getMonth() + 1);
day = String.valueOf(date.getDate());
hour = String.valueOf(date.getHours());
minute = String.valueOf(date.getMinutes());
second = String.valueOf(date.getSeconds());
timeStr = "现在时刻是:" + year + "年" + month + "月" + day + "日" + " "
+ hour + "时" + minute + "分" + second + "秒";
timeButton.setText(timeStr);
}
}
}

public class TimeTest {
public static void main(String[] args) {
MyFrame myFrame = new MyFrame();
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}




flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923