﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-一个人的Java</title><link>http://www.blogjava.net/lemon/</link><description /><language>zh-cn</language><lastBuildDate>Sun, 12 Apr 2026 05:59:49 GMT</lastBuildDate><pubDate>Sun, 12 Apr 2026 05:59:49 GMT</pubDate><ttl>60</ttl><item><title>一个简单日记本的源程序,功能并不完全,请高人指点</title><link>http://www.blogjava.net/lemon/archive/2005/12/25/25371.html</link><dc:creator>lemon</dc:creator><author>lemon</author><pubDate>Sun, 25 Dec 2005 07:35:00 GMT</pubDate><guid>http://www.blogjava.net/lemon/archive/2005/12/25/25371.html</guid><wfw:comment>http://www.blogjava.net/lemon/comments/25371.html</wfw:comment><comments>http://www.blogjava.net/lemon/archive/2005/12/25/25371.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lemon/comments/commentRss/25371.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lemon/services/trackbacks/25371.html</trackback:ping><description><![CDATA[<P>import java.awt.*; <BR>import java.awt.event.*; <BR>import javax.swing.*; <BR>import java.util.*; <BR>import java.text.*; <BR>import java.io.*; <BR>public class Note extends Frame { </P>
<P>private MenuBar mb; <BR>private Menu mset_param ,mhelp; <BR>private MenuItem mibc ,miSound; <BR>private MenuItem miabout; <BR>//缺省的背景颜色 <BR>private static Color backgroundcolor = Color.GRAY; </P>
<P>//funtction of the button on plcb is chose year andmonth <BR>//and set alarm colock and remind booking <BR>private JCheckBox remindBook ,alarmColock; <BR>private JComboBox cbyears ,cbmonths; <BR>private JPanel plcb; <BR>//日历按钮 <BR>private JPanel plbt; <BR>private JButton button[]; <BR>//add vector to contain button[],so that find it <BR>private Vector v; <BR>//save the year and month <BR>private String choseyear ,chosemonth; <BR>private int choseyearint ,chosemonthint; <BR>private boolean changed = false; <BR>private boolean fileExist = false;//the application first run to find file <BR>private static boolean needSound; </P>
<P>//add text to write down what to do in the future <BR>private TextArea tanote; <BR>private JPanel plta; </P>
<P>//默认的年份 <BR>private final static String years[]={ <BR>"1995" ,"1996" ,"1997" ,"1998" ,"1999" ,"2000" , <BR>"2001" ,"2002" ,"2003" ,"2004" ,"2005" ,"2006" , <BR>"2007" ,"2008" ,"2009" ,"2010" ,"2011" ,"2012" , <BR>"2013" ,"2014" ,"2015" ,"2016" ,"2017" ,"2018" , <BR>"2019" ,"2020" <BR>}; </P>
<P>private static final String months[] = { <BR>"January" ,"February" ,"March" ,"April" ,"May" ,"June" ,"July" ,"August" , <BR>"September" ,"October" ,"November" ,"December" <BR>}; </P>
<P>private final static int dom[] = { <BR>31 ,28 ,31 ,30 ,31 ,30 ,31 ,31 ,30 ,31 ,30 ,31 <BR>}; </P>
<P>//save the first day of the month to use <BR>private int start; <BR>//save the button who is entered <BR>private int btnIndex; </P>
<P>public Note() { <BR>mb = new MenuBar(); <BR>mset_param = new Menu("设置"); <BR>mhelp = new Menu("帮助"); <BR>mibc = new MenuItem("背景"); <BR>miSound = new MenuItem("声音"); <BR>miabout = new MenuItem("关于..."); </P>
<P>mset_param.add(mibc); <BR>mset_param.addSeparator(); <BR>mset_param.add(miSound); <BR>mhelp.add(miabout); <BR>setMenuBar(mb); <BR>mb.add(mset_param); <BR>mb.setHelpMenu(mhelp); </P>
<P>MListener ml = new MListener(); <BR>mibc.addActionListener(ml); <BR>miabout.addActionListener(ml); <BR>miSound.addActionListener(ml); </P>
<P>cbyears = new JComboBox(); <BR>cbmonths = new JComboBox(); <BR>plcb = new JPanel(); <BR>plcb.setLayout(new FlowLayout()); <BR>JLabel lyears = new JLabel("年份:"); <BR>JLabel lmonths = new JLabel("月份:"); <BR>plcb.add(lyears); <BR>plcb.add(cbyears); <BR>plcb.add(lmonths); <BR>plcb.add(cbmonths); <BR>remindBook = new JCheckBox("预约提示",true); <BR>alarmColock = new JCheckBox("闹钟"); <BR>// Dimension d = new Dimension(); <BR>// remindBook.setSize(d); <BR>// remindBook.getSize(d); <BR>// System.out.println("W:"+d.getWidth()+" H:"+d.getHeight()); <BR>plcb.add(remindBook); <BR>plcb.add(alarmColock); <BR>remindBook.addActionListener(new RemindListener()); <BR>alarmColock.addActionListener(new RemindListener()); <BR>add(plcb ,BorderLayout.NORTH); </P>
<P>//add calendar <BR>getCalendar(); </P>
<P>plbt = new JPanel(); <BR>plbt.setBackground(Color.BLUE); <BR>plbt.setLayout(new GridLayout(7 ,7)); </P>
<P>plbt.add(new JLabel(" 星期日")); <BR>plbt.add(new JLabel(" 星期一")); <BR>plbt.add(new JLabel(" 星期二")); <BR>plbt.add(new JLabel(" 星期三")); <BR>plbt.add(new JLabel(" 星期四")); <BR>plbt.add(new JLabel(" 星期五")); <BR>plbt.add(new JLabel(" 星期六")); </P>
<P>//add calendar button to frame <BR>//add button to vector; <BR>v = new Vector(); <BR>button = new JButton[42]; <BR>for(int i=0;i&lt;41;i++){ <BR>button[i] = new JButton(); <BR>plbt.add(button[i]); <BR>button[i].addActionListener(new ButtonListener()); <BR>v.add(button[i]); <BR>} </P>
<P>button[41] = new JButton(); <BR>plbt.add(button[41]); <BR>button[41].setText("保存"); <BR>button[41].addActionListener(new SaveListener()); <BR>add(plbt ,BorderLayout.CENTER); </P>
<P>//add note book <BR>// plta = new JPanel(); <BR>tanote = new TextArea(5 ,80); <BR>// tanote.addTextListener(new tanoteTextListener()); <BR>// tanote.setColumns(80); <BR>// plta.add(tanote); <BR>// tanote.SCROLLBARS_VERTICAL_ONLY; <BR>add(tanote ,BorderLayout.SOUTH); </P>
<P>/* <BR>//add date to button <BR>GregorianCalendar calendar = new GregorianCalendar(choseyearint ,chosemonthint ,1); <BR>int start = calendar.get(Calendar.DAY_OF_WEEK)-1; <BR>int daysInMonth = dom[chosemonthint]; <BR>if(calendar.isLeapYear(choseyearint)&amp;&amp;chosemonthint == 1){ <BR>++daysInMonth; <BR>} <BR>for(int i =0;i&lt;daysInMonth;i++){ <BR>button[start+i].setText(" "+(i+1)+" "); <BR>} <BR>*/ <BR>//add the default year and month to JComboBox <BR>for(int i= 0;i&lt;=25;i++){ <BR>cbyears.addItem(years[i]); <BR>} <BR>for(int i=0;i&lt;12;i++){ <BR>cbmonths.addItem(months[i]); <BR>} <BR>/* <BR>//add current year and month <BR>cbyears.setSelectedIndex(choseyearint-1995); <BR>cbmonths.setSelectedIndex(chosemonthint); <BR>*/ </P>
<P>//show date to calendar <BR>showDate(); <BR>//open file add to note <BR>Calendar now = new GregorianCalendar(); <BR>int num = start + now.get(Calendar.DAY_OF_MONTH)-1; <BR>btnIndex = num; <BR>readFile(num); <BR>fileSound(); </P>
<P>//add threadcb to listen jcombobox state <BR>new ThreadCB().start(); </P>
<P>//listen the JComboBox of years and months <BR>cbyears.addItemListener(new cbyearsItemListener()); <BR>cbmonths.addItemListener(new cbmonthsItemListener()); </P>
<P>addWindowListener(new WindowAdapter() { <BR>public void windowClosing(WindowEvent e) { <BR>dispose(); <BR>System.exit(0); <BR>} <BR>}); <BR>} </P>
<P>/** <BR>*add menu listener to know the menu what do want to do <BR>*/ <BR>class MListener implements ActionListener{ <BR>public void actionPerformed(ActionEvent e){ <BR>MenuItem i = (MenuItem)e.getSource(); <BR>if(i.equals(miabout)){ <BR>JOptionPane.showMessageDialog(null ,"日历记事本程序V1.0","关于..." ,JOptionPane.INFORMATION_MESSAGE); <BR>} <BR>else if(i.equals(mibc)){ <BR>//backgroundcolor = Color.BLACK; <BR>backgroundcolor = JColorChooser.showDialog(null ,"选择颜色..." ,getBackground()); <BR>setBackground(backgroundcolor); <BR>plbt.setBackground(backgroundcolor); <BR>// System.out.println(choseyear); <BR>//// <BR>} <BR>else{ <BR>JOptionPane.showMessageDialog(null ,"I am sorry ,this function is not complation" ,"Sorry" ,JOptionPane.INFORMATION_MESSAGE); <BR>} <BR>} <BR>} </P>
<P>/** <BR>*add the year JComboBox listener to know what active <BR>*/ <BR>class cbyearsItemListener implements ItemListener{ <BR>public void itemStateChanged(ItemEvent e){ <BR>// System.out.println(e.paramString()); <BR>// System.out.println(e.getStateChange()); <BR>// System.out.println(e.getItem().toString()); <BR>// if(e.getSource().equals("1997")){ <BR>// System.out.println("1997 is chosed"); <BR>// } <BR>// else{ <BR>// System.out.println("the System is not chose 1997"); <BR>// } <BR>// choseyear = e.getItem().toString(); <BR>changed = true; <BR>// showDate(); <BR>// cbmonths.setSelectedIndex(5); <BR>} <BR>} </P>
<P>/** <BR>*add the month JComboBox listener to know what active <BR>*/ <BR>class cbmonthsItemListener implements ItemListener{ <BR>public void itemStateChanged(ItemEvent e){ <BR>// System.out.println(choseyear); <BR>// chosemonth = e.getItem().toString(); <BR>changed = true; </P>
<P>// chosemonthint = Integer.parseInt(chosemonth); <BR>// System.out.println(chosemonthint); <BR>// showDate(); <BR>} <BR>} </P>
<P>public static void main(String args[]) { <BR>System.out.println("Starting Note..."); <BR>Note mainFrame = new Note(); <BR>mainFrame.setSize(600, 400); <BR>mainFrame.setTitle("日历记事本"); <BR>mainFrame.setBackground(backgroundcolor); <BR>mainFrame.setVisible(true); <BR>for(int i=0;i&lt;10;i++){ <BR>System.out.print("\007"); <BR>} <BR>// Thread dd = new ThreadCB(); <BR>// dd.start(); <BR>// mainFrame.paintCalendar(); <BR>} </P>
<P>protected void getCalendar(){ <BR>Calendar now = new GregorianCalendar(); <BR>// System.out.println("year :"+now.get(Calendar.YEAR)); <BR>// System.out.println("month:"+now.get(Calendar.MONTH)); <BR>// int y = now.get(Calendar.YEAR); <BR>// choseyear = Integer.toString(y); <BR>// int m = now.get(Calendar.MONTH); <BR>// chosemonth = Integer.toString(m+1); <BR>choseyearint = now.get(Calendar.YEAR); <BR>chosemonthint = now.get(Calendar.MONTH); <BR>// System.out.println("y "+choseyear+"::"+chosemonth); <BR>} </P>
<P>/** <BR>*show date to calendar <BR>*/ <BR>protected void showDate(){ <BR>GregorianCalendar calendar = new GregorianCalendar(choseyearint ,chosemonthint ,1); <BR>start = calendar.get(Calendar.DAY_OF_WEEK)-1; <BR>int daysInMonth = dom[chosemonthint]; <BR>if(calendar.isLeapYear(choseyearint)&amp;&amp;chosemonthint == 1){ <BR>++daysInMonth; <BR>} <BR>for(int i =0;i&lt;daysInMonth;i++){ <BR>button[start+i].setForeground(Color.BLACK); <BR>button[start+i].setText(" "+(i+1)+" "); <BR>} <BR>//set current day <BR>int nowDay = start + calendar.get(Calendar.DAY_OF_MONTH); <BR>button[nowDay+1].setForeground(Color.RED); <BR>//add current year and month <BR>cbyears.setSelectedIndex(choseyearint-1995); <BR>cbmonths.setSelectedIndex(chosemonthint); <BR>} </P>
<P>//listen the buttons active <BR>class ButtonListener implements ActionListener{ <BR>public void actionPerformed(ActionEvent e){ <BR>Object obj = e.getSource(); <BR>// System.out.println("haha"+e.getSource()); <BR>btnIndex = v.indexOf(obj); <BR>readFile(btnIndex); <BR>/* switch(v.indexOf(obj)){ <BR>case 1: <BR>System.out.println("i am button1"); <BR>break; <BR>case 2: <BR>// System.out.println("I am button2"); <BR>readFile(2); <BR>break; <BR>case 41: <BR>System.out.println(tanote.getText()); <BR>break; <BR>default: <BR>System.out.println("I do not know who am I"); <BR>break; <BR>} <BR>*/ } <BR>} </P>
<P>/** <BR>*create a thread to listen the year or month′s state <BR>*/ <BR>class ThreadCB extends Thread{ <BR>public void run(){ <BR>while(true){ <BR>if(changed){ <BR>changed = false; <BR>choseyearint = cbyears.getSelectedIndex()+1995; <BR>chosemonthint = cbmonths.getSelectedIndex(); <BR>//System.out.println("y:"+choseyearint+":M:"+chosemonthint); <BR>for(int i=0;i&lt;40;i++){ <BR>button[i].setText(""); <BR>} <BR>showDate(); <BR>} <BR>try{ <BR>sleep(200); <BR>} <BR>catch(InterruptedException e){ <BR>System.err.println(e); <BR>} <BR>} <BR>} <BR>} </P>
<P>/** <BR>* add note book listener to know the textarea active <BR>*/ <BR>/* <BR>class tanoteTextListener implements TextListener{ <BR>public void textValueChanged(TextEvent e){ <BR>//System.out.println(e.getSource()); <BR>} <BR>}*/ </P>
<P>/** <BR>*check file to know the file is exist <BR>* if exist,read it to the note book <BR>*/ <BR>protected void readFile(int bt){ <BR>int y = cbyears.getSelectedIndex()+1995;//real year <BR>int m = cbmonths.getSelectedIndex()+1;//real month <BR>String fileName = Integer.toString(y) + Integer.toString(m)+"button"+Integer.toString(bt); <BR>// System.out.println("I am dudu"); <BR>// System.out.println(fileName); <BR>// String fileName = "testDay.java"; </P>
<P>File file = new File(fileName); <BR>BufferedReader is; <BR>String line; <BR>StringBuffer sb = new StringBuffer(); </P>
<P>tanote.setText(""); <BR>if(file.exists()){ <BR>try{ <BR>is = new BufferedReader(new FileReader(fileName)); </P>
<P>while((line = is.readLine())!= null){ <BR>sb.append(line); <BR>sb.append("\n"); <BR>} <BR>is.close(); <BR>} <BR>catch(IOException e){ <BR>System.err.println(e); <BR>System.exit(0); <BR>} <BR>tanote.setText(sb.toString()); <BR>fileExist = true; <BR>} <BR>else{ <BR>System.out.println(fileName+" is not exists"); <BR>} </P>
<P>} </P>
<P>/** <BR>*sound <BR>*/ <BR>protected void fileSound(){ <BR>if(remindBook.isSelected()){ <BR>if(fileExist){ <BR>/* for(int i=0;i&lt;10;i++){ <BR>System.out.println("\007"); <BR>} <BR>*/ <BR>needSound = true; <BR>} <BR>} <BR>} </P>
<P>/** <BR>*listen the save button active <BR>*/ <BR>class SaveListener implements ActionListener{ <BR>public void actionPerformed(ActionEvent e){ <BR>int bt = btnIndex; <BR>int y = cbyears.getSelectedIndex()+1995;//real year <BR>int m = cbmonths.getSelectedIndex()+1;//real month <BR>String fileName = Integer.toString(y) + Integer.toString(m)+"button"+Integer.toString(bt); </P>
<P>try{ <BR>BufferedWriter bw = new BufferedWriter(new FileWriter(fileName)); <BR>//int row = tanote.getRows(); <BR>//System.out.println("rows:"+row); <BR>String s = tanote.getText(); <BR>System.out.println("length:"+s.length()); <BR>bw.write(s); </P>
<P>bw.close(); <BR>} <BR>catch(IOException ev){ <BR>System.err.println(ev); <BR>System.exit(0); <BR>} <BR>} <BR>} </P>
<P>// <BR>class RemindListener implements ActionListener{ <BR>public void actionPerformed(ActionEvent ae){ <BR>Object obj = ae.getSource(); <BR>if(obj.equals(remindBook)){ <BR>if(remindBook.isSelected()){ <BR>System.out.println("I am selected"); <BR>} <BR>else{ <BR>System.out.println("I am not selected"); <BR>} <BR>} <BR>else{ <BR>if(alarmColock.isSelected()){ <BR>// System.out.println("I am selected"); <BR>final JFrame jf = new JFrame("设置时间"); <BR>jf.setSize(300,100); <BR>jf.setLocation(200 ,200); <BR>jf.setVisible(true); <BR>// Font f = new Font( ,Font.BOLD ,20); <BR>JLabel jl = new JLabel("逗你玩"); <BR>String name=jl.getFont().getName(); <BR>// System.out.println("Font:"+name);//name′s value is Dialog <BR>Font f = new Font(name ,Font.BOLD+Font.ITALIC ,20); <BR>jl.setForeground(Color.red); <BR>jl.setFont(f); <BR>jf.getContentPane().setLayout(new GridLayout(5 ,2)); <BR>jf.getContentPane().add(new JLabel(" ")); <BR>jf.getContentPane().add(jl); <BR>jf.getContentPane().add(new JLabel("sorry! this function is not do!!")); <BR>jf.pack(); <BR>jf.addWindowListener(new WindowAdapter(){ <BR>public void windowClosing(WindowEvent we){ <BR>jf.dispose(); <BR>} <BR>}); <BR>} <BR>else{ <BR>System.out.println("I am not selected"); <BR>} <BR>} <BR>} <BR>} <BR>} <BR></P><img src ="http://www.blogjava.net/lemon/aggbug/25371.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lemon/" target="_blank">lemon</a> 2005-12-25 15:35 <a href="http://www.blogjava.net/lemon/archive/2005/12/25/25371.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于JAVA学习</title><link>http://www.blogjava.net/lemon/archive/2005/12/12/23558.html</link><dc:creator>lemon</dc:creator><author>lemon</author><pubDate>Mon, 12 Dec 2005 13:37:00 GMT</pubDate><guid>http://www.blogjava.net/lemon/archive/2005/12/12/23558.html</guid><wfw:comment>http://www.blogjava.net/lemon/comments/23558.html</wfw:comment><comments>http://www.blogjava.net/lemon/archive/2005/12/12/23558.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lemon/comments/commentRss/23558.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lemon/services/trackbacks/23558.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 本人这段时间暂时没有学习JAVA了,所以很少来上面发文章。但我个人觉得JAVA还是很有趣的语言，我以后还会继续学习的，谢谢大家的支持…<img src ="http://www.blogjava.net/lemon/aggbug/23558.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lemon/" target="_blank">lemon</a> 2005-12-12 21:37 <a href="http://www.blogjava.net/lemon/archive/2005/12/12/23558.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>本人博客中国的分栏代码,分享一下</title><link>http://www.blogjava.net/lemon/archive/2005/12/02/22278.html</link><dc:creator>lemon</dc:creator><author>lemon</author><pubDate>Fri, 02 Dec 2005 11:38:00 GMT</pubDate><guid>http://www.blogjava.net/lemon/archive/2005/12/02/22278.html</guid><wfw:comment>http://www.blogjava.net/lemon/comments/22278.html</wfw:comment><comments>http://www.blogjava.net/lemon/archive/2005/12/02/22278.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lemon/comments/commentRss/22278.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lemon/services/trackbacks/22278.html</trackback:ping><description><![CDATA[<P>&lt;!--用iframe来装入2005索引页，这样我们就获得了所有本年度的文章列表了--&gt;<BR>&lt;!--&lt;iframe id="cataloghtml" src="catalog_2005.html" style=display:none;position:absolute;top:400;left:400;z-index:250 </P>
<P>&gt;&lt;/iframe&gt;--&gt;<BR>&lt;script&gt;<BR>var startYear = 2005; //你的博客是哪一年建立的？<BR>var showCount = 10; // 每个栏目显示多少条？</P>
<P><BR>var d = new Date();<BR>var currYear = d.getUTCFullYear();<BR>for(i=currYear;i&gt;=startYear;i--)<BR>{<BR>document.writeln('&lt;iframe id="cataloghtml'+i+'" src="catalog_'+i+'.html" </P>
<P>style=display:none;position:absolute;top:400;left:400;z-index:250 &gt;&lt;/iframe&gt;');<BR>}<BR>&lt;/script&gt;<BR>&lt;script&gt;<BR>//这部分的脚本是自动更新用的<BR>//从cataloghtml的categoryname这个栏目读取文章列表放到当前页面的mycategoryname中<BR>function showcatalog(mycategoryname,categoryname)<BR>{<BR>var currShowCount = 0;<BR>var currTotalCount = 0;<BR>l="&lt;ul type='circle'&gt;";<BR>for(iyear=currYear;iyear&gt;=startYear;iyear--)<BR>{<BR>currCategory = document.body.all[mycategoryname];<BR>ol = eval("cataloghtml"+iyear+".document.body.all");</P>
<P>var entityDiv = null;<BR>for(i=0;i&lt;ol.length;i++)<BR>{<BR>if(ol[i].className =="entity")<BR>{<BR>entityDiv = ol[i];break;<BR>}<BR>}<BR>ol = entityDiv.children.tags("UL");<BR>var oLI=null;<BR>for(i=0;i&lt;ol.length;i++)<BR>{<BR>if(ol[i].children(0).name==categoryname)<BR>{<BR>oLI = ol[i].children.tags("LI");<BR>break;<BR>}<BR>}<BR>if(oLI == null) return ;<BR>for(i=0;i&lt;oLI.length;i++)<BR>{<BR>if(i&gt;showCount-1) break;<BR>oA = oLI[i].children(1);<BR>s = oA.innerHTML;<BR>pos = s.search(/[）|】|』|\]]{1}/);<BR>if(pos&gt;0)s=s.slice(pos+1);<BR>l += "&lt;li style='width:245px;height:18;overflow:hidden'&gt;&lt;a href='"+oA.href+"' target='_blank'&gt;"+s+"&lt;/a&gt;&lt;/li&gt;\r\n";<BR>}<BR>currShowCount += i;<BR>currTotalCount += oLI.length;<BR>}</P>
<P>for(;currShowCount&lt;showCount;currShowCount++)<BR>l += "&lt;li style='width:245px;height:18;overflow:hidden'&gt;...&lt;/li&gt;\r\n";</P>
<P>l+="&lt;/ul&gt;";<BR>currCategory.insertAdjacentHTML("beforeend",l);<BR>// 增加代码，统计栏目文章数<BR>titleDIV = currCategory.parentElement.children(0);<BR>titleDIV.insertAdjacentHTML("beforeend","（"+ currTotalCount +"）");<BR>}</P>
<P><BR>//从cataloghtml读取目录并生成当前页面 </P>
<P>　　function showallcatalog() </P>
<P>　　{ </P>
<P>　　//需要改写的地方之一 </P>
<P>　　showcatalog("mcategory1","category1");//※情感绿洲 </P>
<P>　　showcatalog("mcategory2","category2");//※文学草坪 </P>
<P>　　showcatalog("mcategory3","category3");//※科教园地</P>
<P>　　showcatalog("mcategory4","category4");//※电脑网络<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; showcatalog("mcategory5","category5");//※院校文化 </P>
<P>　　showcatalog("mcategory6","category6");//※都市生活</P>
<P>　　showcatalog("mcategory7","category7");//※影音娱乐</P>
<P>　　showcatalog("mcategory8","category8");//※人在北京 </P>
<P>　　//…… </P>
<P>　　//注意，上面的省略号表示如果还有第九、第十个标题栏时依此类推，写类似的代码 </P>
<P>　　} </P>
<P>　　&lt;/script&gt; </P>
<P>&lt;!--当body装入后调用showallcatalog()装载最新文章列表--&gt; </P>
<P>　　&lt;body onload=showallcatalog()&gt; </P>
<P>&nbsp;&nbsp; </P>
<P>&nbsp;&nbsp;&nbsp; &lt;div&gt;&lt;div class="mydiv1" target="_blank"&gt;&lt;div class="mybg_01" target="_blank"&gt;&lt;a href="<A href="http://liyangbit.blogchina.com/catalog_2005.html#category1">http://liyangbit.blogchina.com/catalog_2005.html#category1</A>" target="_blank"&gt;&lt;img class="myimg" alt="查看更多情感绿洲的文章，请点击此处" src="<A href="http://bimzcy.blogchina.com/inc/go.gif">http://bimzcy.blogchina.com/inc/go.gif</A>" /&gt;&lt;/a&gt;※情感绿洲 &lt;/div&gt;&lt;div class="divtext" id="mcategory1" target="_blank"&gt;&lt;/div&gt;&lt;/div&gt;&lt;!--结束--&gt; </P>
<P>&nbsp;&nbsp;&nbsp; &lt;div&gt;&lt;div class="mydiv2" target="_blank"&gt;&lt;div class="mybg_01" target="_blank"&gt;&lt;a href="<A href="http://liyangbit.blogchina.com/catalog_2005.html#category2">http://liyangbit.blogchina.com/catalog_2005.html#category2</A>" target="_blank"&gt;&lt;img class="myimg" alt="查看更多文学草坪的文章，请点击此处" src="<A href="http://bimzcy.blogchina.com/inc/go.gif">http://bimzcy.blogchina.com/inc/go.gif</A>" /&gt;&lt;/a&gt;※文学草坪&lt;/div&gt;&lt;!--文学部分--&gt;&lt;div class="divtext" id="mcategory2" target="_blank"&gt;&lt;/div&gt;&lt;/div&gt;&lt;!--结束--&gt; </P>
<P>&nbsp;&nbsp;&nbsp; &lt;div&gt;&lt;div class="mydiv1" target="_blank"&gt;&lt;div class="mybg_01" target="_blank"&gt;&lt;a href="<A href="http://liyangbit.blogchina.com/catalog_2005.html#category3">http://liyangbit.blogchina.com/catalog_2005.html#category3</A>" target="_blank"&gt;&lt;img class="myimg" alt="查看更多科教园地的文章，请点击此处" src="<A href="http://bimzcy.blogchina.com/inc/go.gif">http://bimzcy.blogchina.com/inc/go.gif</A>" /&gt;&lt;/a&gt;※科教园地&lt;/div&gt;&lt;div class="divtext" id="mcategory3" target="_blank"&gt;&lt;/div&gt;&lt;/div&gt;&lt;!--结束--&gt; </P>
<P>&nbsp;&nbsp;&nbsp; &lt;div&gt;&lt;div class="mydiv2" target="_blank"&gt;&lt;div class="mybg_01" target="_blank"&gt;&lt;a href="<A href="http://liyangbit.blogchina.com/catalog_2005.html#category4">http://liyangbit.blogchina.com/catalog_2005.html#category4</A>" target="_blank"&gt;&lt;img class="myimg" alt="查看更多电脑网络的文章，请点击此处" src="<A href="http://bimzcy.blogchina.com/inc/go.gif">http://bimzcy.blogchina.com/inc/go.gif</A>" /&gt;&lt;/a&gt;※电脑网络&lt;/div&gt;&lt;div class="divtext" id="mcategory4" target="_blank"&gt;&lt;/div&gt;&lt;/div&gt;&lt;!--结束--&gt; </P>
<P>&nbsp;&nbsp;&nbsp; &lt;div&gt;&lt;div class="mydiv1" target="_blank"&gt;&lt;div class="mybg_01" target="_blank"&gt;&lt;a href="<A href="http://liyangbit.blogchina.com/catalog_2005.html#category5">http://liyangbit.blogchina.com/catalog_2005.html#category5</A>" target="_blank"&gt;&lt;img class="myimg" alt="查看更多院校文化，请点击此处" src="<A href="http://bimzcy.blogchina.com/inc/go.gif">http://bimzcy.blogchina.com/inc/go.gif</A>" /&gt;&lt;/a&gt;※院校文化&lt;/div&gt;&lt;div class="divtext" id="mcategory5" target="_blank"&gt;&lt;/div&gt;&lt;/div&gt;&lt;!--结束--&gt; </P>
<P>&nbsp;&nbsp; &lt;div&gt;&lt;div class="mydiv2" target="_blank"&gt;&lt;div class="mybg_01" target="_blank"&gt;&lt;a href="<A href="http://liyangbit.blogchina.com/catalog_2005.html#category6">http://liyangbit.blogchina.com/catalog_2005.html#category6</A>" target="_blank"&gt;&lt;img class="myimg" alt="查看更多都市生活，请点击此处" src="<A href="http://bimzcy.blogchina.com/inc/go.gif">http://bimzcy.blogchina.com/inc/go.gif</A>" /&gt;&lt;/a&gt;※都市生活&lt;/div&gt;&lt;div class="divtext" id="mcategory6" target="_blank"&gt;&lt;/div&gt;&lt;/div&gt;&lt;!--结束--&gt;</P>
<P>&nbsp;&nbsp; &lt;div&gt;&lt;div class="mydiv1" target="_blank"&gt;&lt;div class="mybg_01" target="_blank"&gt;&lt;a href="<A href='http://liyangbit.bokee.com/catalog_2005.html#category7"target="_blank"><img'>http://liyangbit.bokee.com/catalog_2005.html#category7"target="_blank"&gt;&lt;img</A> class="myimg" alt="查看更多影音娱乐的文章，请点击此处" src="<A href="http://bimzcy.blogchina.com/inc/go.gif">http://bimzcy.blogchina.com/inc/go.gif</A>" /&gt;&lt;/a&gt;※影音娱乐&lt;/div&gt;&lt;!--音乐时空部分--&gt;&lt;div class="divtext" id="mcategory7" target="_blank"&gt;&lt;/div&gt;&lt;/div&gt;&lt;!--结束--&gt; </P>
<P>&nbsp;&nbsp; &lt;div&gt;&lt;div class="mydiv2" target="_blank"&gt;&lt;div class="mybg_01" target="_blank"&gt;&lt;a href="<A href="http://liyangbit.bokee.com/catalog_2005.html#category8">http://liyangbit.bokee.com/catalog_2005.html#category8</A>" target="_blank"&gt;&lt;img class="myimg" alt="查看更多人在北京，请点击此处" src="<A href="http://bimzcy.blogchina.com/inc/go.gif">http://bimzcy.blogchina.com/inc/go.gif</A>" /&gt;&lt;/a&gt;※人在北京&lt;/div&gt;&lt;div class="divtext" id="mcategory8" target="_blank"&gt;&lt;/div&gt;&lt;/div&gt;&lt;!--结束--&gt;</P>
<P>&nbsp;&nbsp; &lt;/div&gt;&lt;/p&gt;</P><img src ="http://www.blogjava.net/lemon/aggbug/22278.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lemon/" target="_blank">lemon</a> 2005-12-02 19:38 <a href="http://www.blogjava.net/lemon/archive/2005/12/02/22278.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>好的Java风格</title><link>http://www.blogjava.net/lemon/archive/2005/10/18/15844.html</link><dc:creator>lemon</dc:creator><author>lemon</author><pubDate>Tue, 18 Oct 2005 13:44:00 GMT</pubDate><guid>http://www.blogjava.net/lemon/archive/2005/10/18/15844.html</guid><wfw:comment>http://www.blogjava.net/lemon/comments/15844.html</wfw:comment><comments>http://www.blogjava.net/lemon/archive/2005/10/18/15844.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lemon/comments/commentRss/15844.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lemon/services/trackbacks/15844.html</trackback:ping><description><![CDATA[为什么代码很重要<BR>尽管JAVA是用来写程序而不是散文， 但它仍然被用来表达思想和观点的。而且，在调查中显示，那些思想和观点在实际中完成了很多事情。为编写出好的JAVA风格而担忧，似乎是在浪费时间， 但实际上它对我们编写程序是很适宜的，因为它所要表达的思想和观点是格外清晰的。 <BR><BR>这里提供一些理由，为什么要使用好的JAVA代码规范 <BR><BR><BR>一个软件产品的80%的生命期是在维护（maintenance）。 <BR>几乎没有一个软件在它的整个生命期里都是被它的作者来维护的。 <BR>使用好的风格提高了软件的可维护性。&nbsp;&nbsp;<BR>如果源代码和软件产品是捆绑给客户的，作为产品的剩余部分，它应该有好的分包（well-packaged），足够清晰和专业的代码。 <BR><BR>使用好的风格编写代码有以下几点好处： <BR><BR><BR>提高了代码的可读性，持续性，和谐性。这些都能使代码能更容易的理解和维护。 <BR>使代码更容易被跟踪和调试，因为它是清晰的和持续的。 <BR>使你或另一个程序员在编写终止时更容易再继续下去，尤其在一个很长的时间后。 <BR>增加了代码预排（walkthroughs）的好处， 因为能让参入者更多的将焦点集中在代码正在做什么。 <BR><BR>概要方针<BR>使用好的JAVA风格并不困难， 但是它确实需要注意细节。下面是一些常用的概要指导方针： <BR><BR><BR>使代码更清晰和更容易读&nbsp;&nbsp;<BR>使代码更持续&nbsp;&nbsp;<BR>使用显而易见的标识符名&nbsp;&nbsp;<BR>逻辑地组织你的文件和类&nbsp;&nbsp;<BR>每个文件只有一个类(这里不包括一些内部类) <BR>使用80-90个字符的最大行宽&nbsp;&nbsp;<BR>明智的使用空格来and/or其他分隔符 <BR>缩排上，使用空格（Space）来代替Tab <BR><BR>Tabs vs. 空格<BR>在编写代码时，“Tabs vs. 空格” 是一个严谨的观点。这里我并不是暗示只有一个正确的方法。我支持使用空格，因为它能保证我的代码在你的编辑器里和我的编辑器里看到的相同，反之矣然。如果你感觉使用空格来代替Tab"不是正确的", 那么就使用Tab吧。 <BR><BR>括号和缩进<BR>在编写代码时，缩进风格(cf., Raymond, "Indent Style")，或者放置括号("{" 和 "}") 和一些相关联的缩进代码，是另一个严谨的观点。象JAVA一样，有许多C风格的语言存在。我这里也不是暗示它们中哪一个更优先更好。在大多数本文的范例代码中，我使用了K&amp;R 风格，如果你不喜欢K&amp;R风格，那么就使用其他风格吧。<BR><BR>注释<BR>在JAVA代码中你可以使用两种注释： Javadoc 注释 (也称为文档注释) 和执行注释。 Javadoc注释能够被javadoc工具解压来制造一个API文档。执行注释是那些解释代码目的和方式的注释。在注释你的JAVA代码时请使用以下方针： <BR><BR><BR>尽可能的使用Javadoc注释(在类和方法上，使之能最小化). <BR>多使用块注释，少使用//注释, 除非一些特殊的情况，如变量声明<BR>要记住：好注释是有帮助的，坏注释是麻烦的。 <BR><BR>Example 1. Bad Comment Style<BR><BR>// applyRotAscii() -- Apply ASCII ROT<BR>&nbsp;&nbsp; private void applyRotAscii(){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int rotLength = Integer.parseInt(rotationLengthField.getText().trim()); // get rot len<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RotAscii cipher = new RotAscii(rotLength); // new cipher<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textArea.setText(cipher.transform(textArea.getText())); // transform<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}catch(Exception ex){ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Show exception */<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExceptionDialog.show(this, "Invalid rotation length: ", ex); }<BR>&nbsp;&nbsp; }<BR><BR><BR><BR>Example 2. Good Comment Style<BR><BR>/**<BR>&nbsp;&nbsp;&nbsp;&nbsp;* Apply the ASCII rotation cipher to the user's text. The length is retrieved<BR>&nbsp;&nbsp;&nbsp;&nbsp;* from the rotation length field, and the user's text is retrieved from the<BR>&nbsp;&nbsp;&nbsp;&nbsp;* text area.<BR>&nbsp;&nbsp;&nbsp;&nbsp;*<BR>&nbsp;&nbsp;&nbsp;&nbsp;* @author Thornton Rose<BR>&nbsp;&nbsp;&nbsp;&nbsp;*/<BR>&nbsp;&nbsp; private void applyRotAscii() {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rotLength = 0;&nbsp;&nbsp;// rotation length<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RotAscii cipher = null;&nbsp;&nbsp;// ASCII rotation cipher<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Get rotation length field and convert to integer.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rotLength = Integer.parseInt(rotationLengthField.getText().trim());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Create ASCII rotation cipher and transform the user's text with it.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cipher = new RotAscii(rotLength);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textArea.setText(cipher.transform(textArea.getText()));<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch(Exception ex) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Report the exception to the user.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExceptionDialog.show(this, "Invalid rotation length: ", ex);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp; }<BR><BR><BR><BR>块和语句<BR>使用下面的方针来编写块和语句： <BR><BR><BR>一行只写一个语句&nbsp;&nbsp;<BR>控制语句总是使用{}这样的括号 (e.g., 'if'). <BR>考虑在块的末尾使用一个注释 (e.g., } // end if), 尤其是长的或嵌套块 <BR>在块的开头放置变量的声明语句&nbsp;&nbsp;<BR>总记得初始化变量&nbsp;&nbsp;<BR>如果你是个完美主义者，左对齐变量名 <BR>在switch块里缩进case从句&nbsp;&nbsp;<BR>在操作符后留有空白 <BR>在if, for, 或while语句中， 在括号“（”前留有空白 <BR>在表达式中使用空白和插入语来增强可读性 <BR><BR>在for循环中的变量是个例外。 循环变量可能会在语句初始化部分被定义。 e.g., for (int i = 0; ...)<BR><BR>. <BR><BR>在块的末尾插入注释有助于你无意中跟踪到被删除的结尾括号“}”.<BR><BR>Example 3. Bad Block Style.<BR><BR>try{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(int i=0;i&lt;5;i++){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int threshold=calculateThreshold(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float variance=(threshold*2.8)-1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int c=0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (threshold&lt;=15) c=calculateCoefficient();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch(c){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case 1: setCeiling(c*2); break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case 2: setCeiling(c*3); break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else: freakOut();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp; }catch(Exception ex){ ... }<BR><BR><BR><BR>Example 4. Good Block Style.<BR><BR>try {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;&nbsp; threshold&nbsp;&nbsp;= 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float variance&nbsp;&nbsp;&nbsp;&nbsp;= 0.0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;&nbsp; coefficient = 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Prepare 5 cycles.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int i = 0; i &lt; 5; i ++){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; prepareCycle(i);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Calculate the threshold and variance.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;threshold = calculateThreshold();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;variance = (threshold * 2.8) - 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// If the threshold is less than the maximum, calculate the coefficient.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Otherwise, throw an exception.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (threshold &lt;= MAX_THRESHOLD) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; coefficient = calculateCoefficient();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new RuntimeException("Threshold exceeded!");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Set the ceiling based on the coefficient.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch (coefficient) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 1: <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setCeiling(coefficient * 2); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 2: <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setCeiling(coefficient * 3); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else: <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;freakOut();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} // end switch<BR>&nbsp;&nbsp; } catch(Exception ex) { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;... <BR>&nbsp;&nbsp; } // end try<BR><img src ="http://www.blogjava.net/lemon/aggbug/15844.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lemon/" target="_blank">lemon</a> 2005-10-18 21:44 <a href="http://www.blogjava.net/lemon/archive/2005/10/18/15844.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于BlogJava</title><link>http://www.blogjava.net/lemon/archive/2005/10/09/15040.html</link><dc:creator>lemon</dc:creator><author>lemon</author><pubDate>Sun, 09 Oct 2005 02:29:00 GMT</pubDate><guid>http://www.blogjava.net/lemon/archive/2005/10/09/15040.html</guid><wfw:comment>http://www.blogjava.net/lemon/comments/15040.html</wfw:comment><comments>http://www.blogjava.net/lemon/archive/2005/10/09/15040.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lemon/comments/commentRss/15040.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lemon/services/trackbacks/15040.html</trackback:ping><description><![CDATA[&nbsp;&nbsp; 先在这里注册了一个Blog，对这里的情况还不是很了解。期待以后本Blog有比较好的人气吧，呵呵！<img src ="http://www.blogjava.net/lemon/aggbug/15040.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lemon/" target="_blank">lemon</a> 2005-10-09 10:29 <a href="http://www.blogjava.net/lemon/archive/2005/10/09/15040.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>