<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>一起去看海 &#187; java工具</title>
	<atom:link href="http://www.ooobj.com/tag/java%e5%b7%a5%e5%85%b7/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ooobj.com</link>
	<description>ooobj.com</description>
	<lastBuildDate>Sat, 14 Jan 2012 13:48:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>调试工具1.1版</title>
		<link>http://www.ooobj.com/2010/05/debug1-1/</link>
		<comments>http://www.ooobj.com/2010/05/debug1-1/#comments</comments>
		<pubDate>Mon, 17 May 2010 14:15:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java笔记]]></category>
		<category><![CDATA[java工具]]></category>

		<guid isPermaLink="false">http://www.ooobj.com/?p=26394</guid>
		<description><![CDATA[上周写了个调试工具，功能很简单http://www.ooobj.com/2010/05/debug-tool/。今天给加了个查找的功能，代码从网上找的记事本代码中抽出来的，呵呵。
部分代码：
[java]private DebugMsg() {
 f = new JFrame(&#34;调试工具&#34;);
 Container contentPane = f.getContentPane();
 contentPane.setLayout(new BorderLayout());
 textArea = new JTextArea(20, 40);
 textArea.setEditable(false);
 JScrollPane scroll = new JScrollPane(textArea);
 JButton clear = new JButton(&#34;清除&#34;);
 clear.addActionListener(new ActionListener() {
 public void actionPerformed(ActionEvent e) {
 clearText();
 }
 });
 JMenuBar menuBar = new JMenuBar();
 JMenu toolMenu = new JMenu(&#34;工具&#34;);
 menuBar.add(toolMenu);
 JMenu helpMenu = new [...]]]></description>
			<content:encoded><![CDATA[<p>上周写了个调试工具，功能很简单<a title="调试工具" href="http://www.ooobj.com/2010/05/debug-tool/" target="_blank">http://www.ooobj.com/2010/05/debug-tool/</a>。今天给加了个查找的功能，代码从网上找的记事本代码中抽出来的，呵呵。</p>
<p>部分代码：</p>
<p>[java]private DebugMsg() {<br />
 f = new JFrame(&quot;调试工具&quot;);<br />
 Container contentPane = f.getContentPane();<br />
 contentPane.setLayout(new BorderLayout());</p>
<p> textArea = new JTextArea(20, 40);<br />
 textArea.setEditable(false);<br />
 JScrollPane scroll = new JScrollPane(textArea);</p>
<p> JButton clear = new JButton(&quot;清除&quot;);<br />
 clear.addActionListener(new ActionListener() {<br />
 public void actionPerformed(ActionEvent e) {<br />
 clearText();<br />
 }<br />
 });</p>
<p> JMenuBar menuBar = new JMenuBar();<br />
 JMenu toolMenu = new JMenu(&quot;工具&quot;);<br />
 menuBar.add(toolMenu);<br />
 JMenu helpMenu = new JMenu(&quot;帮助&quot;);<br />
 menuBar.add(helpMenu);</p>
<p> JMenuItem helpItem = new JMenuItem(&quot;使用帮助&quot;);<br />
 helpItem.addActionListener(new ActionListener(){<br />
 public void actionPerformed(ActionEvent e) {<br />
 textArea.setText(&quot;Ctrl+F 查找\n&quot; +<br />
 &quot;Ctrl+D 清除消息\n&quot; +<br />
 &quot;Ctrl+Q 退出\n&quot; +<br />
 &quot;查看更新：www.ooobj.com\n&quot;);<br />
 }<br />
 });<br />
 helpMenu.add(helpItem);</p>
<p> JMenuItem findItem = new JMenuItem(&quot;查找&quot;);<br />
 findItem.addActionListener(new ActionListener() {<br />
 public void actionPerformed(ActionEvent e) {<br />
 mySearch();<br />
 }<br />
 });<br />
 findItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, Event.CTRL_MASK));<br />
 toolMenu.add(findItem);</p>
<p> JMenuItem clearItem = new JMenuItem(&quot;清除&quot;);<br />
 clearItem.addActionListener(new ActionListener() {<br />
 public void actionPerformed(ActionEvent e) {<br />
 clearText();<br />
 }<br />
 });<br />
 clearItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, Event.CTRL_MASK));<br />
 toolMenu.add(clearItem);</p>
<p> JMenuItem quitItem = new JMenuItem(&quot;退出&quot;);<br />
 quitItem.addActionListener(new ActionListener() {<br />
 public void actionPerformed(ActionEvent e) {<br />
 System.exit(-1);<br />
 }<br />
 });<br />
 quitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, Event.CTRL_MASK));<br />
 toolMenu.add(quitItem);</p>
<p> contentPane.add(scroll, BorderLayout.CENTER);<br />
 contentPane.add(clear, BorderLayout.SOUTH);<br />
 contentPane.add(menuBar, BorderLayout.NORTH);</p>
<p> f.pack();<br />
 f.setVisible(true);<br />
 f.addWindowListener(new WindowAdapter() {<br />
 public void windowClosing(WindowEvent e) {<br />
 System.exit(0);<br />
 }<br />
 });</p>
<p> }[/java]</p>
<p><a href="http://www.ooobj.com/wp-content/uploads/2010/05/DebugMsg.zip">调试工具1.1代码下载</a></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-26396" title="调试工具" src="http://www.ooobj.com/wp-content/uploads/2010/05/debug.jpg" alt="调试工具" width="252" height="267" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooobj.com/2010/05/debug1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一个简单的信息输出调试工具</title>
		<link>http://www.ooobj.com/2010/05/debug-tool/</link>
		<comments>http://www.ooobj.com/2010/05/debug-tool/#comments</comments>
		<pubDate>Sun, 09 May 2010 01:46:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java笔记]]></category>
		<category><![CDATA[java工具]]></category>

		<guid isPermaLink="false">http://www.ooobj.com/?p=26382</guid>
		<description><![CDATA[平时做项目经常需要debug但是没办法debug，于是都要system.out来查看相关的信息。前几天做项目的时候突然发现system.out失灵了，估计是在哪里被重定向了，急切间又找不到在哪个地方恢复。于是自己写了一个小工具来帮助开发。
[java]package com.ooobj.debug;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class DebugMsg {
 private JTextArea textArea = null;
 private static DebugMsg dm = null;
 public static DebugMsg getInstance() {
 if (dm == null) {
 dm = new DebugMsg();
 }
 return dm;
 }
 private DebugMsg() {
 JFrame f = new JFrame(&#34;Debug Message&#34;);
 Container contentPane [...]]]></description>
			<content:encoded><![CDATA[<p>平时做项目经常需要debug但是没办法debug，于是都要system.out来查看相关的信息。前几天做项目的时候突然发现system.out失灵了，估计是在哪里被重定向了，急切间又找不到在哪个地方恢复。于是自己写了一个小工具来帮助开发。</p>
<p>[java]package com.ooobj.debug;</p>
<p>import java.awt.BorderLayout;<br />
import java.awt.Container;<br />
import java.awt.event.ActionEvent;<br />
import java.awt.event.ActionListener;<br />
import java.awt.event.WindowAdapter;<br />
import java.awt.event.WindowEvent;</p>
<p>import javax.swing.JButton;<br />
import javax.swing.JFrame;<br />
import javax.swing.JScrollPane;<br />
import javax.swing.JTextArea;</p>
<p>public class DebugMsg {</p>
<p> private JTextArea textArea = null;</p>
<p> private static DebugMsg dm = null;</p>
<p> public static DebugMsg getInstance() {<br />
 if (dm == null) {<br />
 dm = new DebugMsg();<br />
 }<br />
 return dm;<br />
 }</p>
<p> private DebugMsg() {<br />
 JFrame f = new JFrame(&quot;Debug Message&quot;);<br />
 Container contentPane = f.getContentPane();<br />
 contentPane.setLayout(new BorderLayout());</p>
<p> textArea = new JTextArea(20, 40);<br />
 textArea.setEditable(false);<br />
 JScrollPane scroll = new JScrollPane(textArea);</p>
<p> JButton clear = new JButton(&quot;Clear Messages&quot;);<br />
 clear.addActionListener(new ActionListener() {<br />
 public void actionPerformed(ActionEvent e) {<br />
 clearText();<br />
 }<br />
 });</p>
<p> contentPane.add(scroll, BorderLayout.CENTER);<br />
 contentPane.add(clear, BorderLayout.SOUTH);</p>
<p> f.pack();<br />
 f.setVisible(true);<br />
 f.addWindowListener(new WindowAdapter() {<br />
 public void windowClosing(WindowEvent e) {<br />
 System.exit(0);<br />
 }<br />
 });</p>
<p> }</p>
<p> private void clearText() {<br />
 textArea.setText(&quot;&quot;);<br />
 }</p>
<p> public void writeText(String text) {<br />
 textArea.append(text);<br />
 }</p>
<p> public static void outMsg(String msg) {<br />
 DebugMsg t = DebugMsg.getInstance();<br />
 t.writeText(msg + &quot;\n&quot;);<br />
 }</p>
<p>}[/java]</p>
<p>功能很简单，只一个输出窗口输出信息，还有一个清除按钮可以清除信息。使用了单例模式，这样只需要使用DebugMsg.outMsg()就可以输出信息。</p>
<p>后面有时间的话还打算继续完善一下，可以增加查找功能，可以在输出信息中查找相关词语；还有高亮功能，可以让不同地方输出的信息背景颜色不一样。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooobj.com/2010/05/debug-tool/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

