博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年7月24日

摘要: #include <iostream>#include <string>#include <algorithm>using namespace std;int main(){ string str1("we are here!"); string str2(str1); reverse(&str1[0],&str1[0]+12); cout <<str1<<endl; copy(&str1[0],... 阅读全文

posted @ 2012-07-24 17:15 紫冰龙 阅读(103) 评论(0) 推荐(0) 编辑

2012年5月15日

摘要: import java.io.File;import javax.swing.*;public class TestResouce extends JFrame { public TestResouce() { setSize(500,500); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); String filename = TestResouce.class.getResource("TestResouce.class").getFile(); JTextArea... 阅读全文

posted @ 2012-05-15 23:42 紫冰龙 阅读(267) 评论(0) 推荐(0) 编辑

摘要: import java.util.*;import java.io.*;public class TestScanner { public static void main(String[] args) { Scanner in = new Scanner(System.in); while(in.hasNextInt()) { int str = in.nextInt(); if (str==0) break; else Syste... 阅读全文

posted @ 2012-05-15 23:41 紫冰龙 阅读(148) 评论(0) 推荐(0) 编辑

摘要: import java.awt.*;import javax.swing.*;import java.awt.Event.*;import java.awt.geom.*;import javax.swing.event.*;public class TextTest { public static void main(String[] args){ new TextFrame(); }}class TextFrame extends JFrame { private ClockPanel clock; private JTextField hourFie... 阅读全文

posted @ 2012-05-15 23:39 紫冰龙 阅读(234) 评论(0) 推荐(0) 编辑

摘要: import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.awt.geom.Ellipse2D;import java.util.ArrayList;import java.util.Random;public class ThreadTestBall extends JFrame { private ArrayList<Ellipse2D> balls; private BallPanel ballPanel; public ThreadTestBall(){ ball... 阅读全文

posted @ 2012-05-15 23:38 紫冰龙 阅读(231) 评论(0) 推荐(0) 编辑

摘要: import javax.swing.*;import javax.swing.tree.DefaultMutableTreeNode;import java.awt.*;import java.io.File;public class TreeDemo extends JFrame { JTree tree; public TreeDemo(){ super("A tree"); setSize(400,400); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLoca... 阅读全文

posted @ 2012-05-15 23:36 紫冰龙 阅读(359) 评论(0) 推荐(0) 编辑

摘要: import java.util.Map.Entry;import javax.swing.*;import javax.swing.UIDefaults;import javax.swing.UIManager;public class UIDeafultsdemo { public static void main(String[] args) { JButton bt = new JButton(); JFrame jf = new JFrame(); JEditorPane jp = new JEditorPane(); U... 阅读全文

posted @ 2012-05-15 23:35 紫冰龙 阅读(504) 评论(0) 推荐(0) 编辑

摘要: import java.io.IOException;import java.io.InputStream;import java.net.MalformedURLException;import java.net.Socket;import java.net.URL;import java.util.Scanner;public class UrlTest { public static void main(String[] args) throws IOException{ URL url = new URL("http://www.baidu.com/"); Inpu 阅读全文

posted @ 2012-05-15 23:33 紫冰龙 阅读(237) 评论(0) 推荐(0) 编辑

摘要: /** @version 1.30 2004-08-05 @author Cay Horstmann*/import java.net.*;import java.sql.*;import java.awt.*;import java.awt.event.*;import java.io.*;import java.util.*;import javax.swing.*;import oracle.jdbc.pool.*;/** This program uses metadata to display arbitrary tables in a database.*/publ... 阅读全文

posted @ 2012-05-15 23:32 紫冰龙 阅读(163) 评论(0) 推荐(0) 编辑

摘要: import javax.swing.*;import java.awt.event.*;public class WinCloseTest extends JFrame { public WinCloseTest(){ setTitle("WinCloseTest"); setSize(400,300); addWindowListener(new MyWinListener()); setVisible(true); } public static void main(String[] args){ n... 阅读全文

posted @ 2012-05-15 23:30 紫冰龙 阅读(497) 评论(0) 推荐(0) 编辑