TreeS用的相关实例

import java.util.TreeSet;import java.util.Iterator;public class TestTreeSet{ public static void main(String[] args) { TreeSet ts = new TreeSet(); ts.add("orange"); ts.add("banana"); ts.add("apple"); ts.add("grape"); Iterator it = ts.iterator(); ...
集合 | 2010-05-21 10:13 | 阅读 787 次 | 评论 0 条

hashset的实例

package com.yds.review.list11;import java.util.Date;import java.util.HashSet;import java.util.Iterator;public class TestHashSet{ public static void main(String[] args) { HashSet h = new HashSet(); h.add("1st"); h.add("2nd"); h.add(new Integer(3)); h.add(new...
集合 | 2010-05-21 10:05 | 阅读 947 次 | 评论 0 条

Iterator

import java.util.Date;import java.util.ArrayList;import java.util.Vector;import java.util.Iterator;public class TestIterator{ public static void main(String[] args) { ArrayList a = new ArrayList(); a.add("China"); a.add("USA"); a.add("Korea"); Iterator it...
集合 | 2010-05-21 09:58 | 阅读 800 次 | 评论 0 条

stack的实例

import java.util.Date;import java.util.Stack;public class TestStack{ public static void main(String[] args) { Stack s = new Stack(); s.push("hello"); s.push(new Date()); s.push(400); //自动封装,等价于s.push(new Integer(400)); s.push(3.14); System.o...
集合 | 2010-05-21 09:51 | 阅读 851 次 | 评论 0 条

vector实例

package com.yds.review.list11;import java.util.Date;import java.util.Vector;public class TestVector{ public static void main(String[] args) { Vector v = new Vector(); v.add("1st"); v.add("2nd"); v.add(new Integer(3)); v.add(new Double(4.0)); v.add("2...
集合 | 2010-05-21 09:44 | 阅读 987 次 | 评论 0 条

第一个实例

package com.yds.review.list11;import java.util.Date;import java.util.ArrayList;public class TestArrayList{ public static void main(String[] args) { ArrayList h = new ArrayList(); h.add("1st"); h.add("2nd"); h.add(new Integer(3)); h.add(new Double(4.0)); ...
集合 | 2010-05-21 09:42 | 阅读 864 次 | 评论 0 条

第一个Swing程序

package com.yds.gui.applet;import java.awt.Color;import java.awt.Container;import java.awt.GridLayout;import javax.swing.JFrame;import javax.swing.JLabel;public class JFtext1 { /** * @param args */ public static void main(String[] args) { JFrame jf=new JFrame(); Cont...
awt和Sring | 2010-05-20 20:24 | 阅读 913 次 | 评论 0 条

打开文件对话框和保存文件对话框

package com.yds.gui.fourpart;import java.awt.Button;import java.awt.FileDialog;import java.awt.Frame;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;public class FileSave implements ActionListener{ Button b1,b2; FileDialog f_open,f_save; Frame f; public void Ui(){...
awt和Sring | 2010-05-20 16:43 | 阅读 1053 次 | 评论 0 条

有子窗口的应用

import java.awt.*;import java.awt.event.*;public class TestDialog implements ActionListener{ private Label info; private Dialog loginDialog; private Dialog quitDialog; private TextField tf_name; private TextField tf_psw; public static void main( String args[]) { new Tes...
awt和Sring | 2010-05-20 16:14 | 阅读 820 次 | 评论 0 条

带事件的用户注册

package com.yds.gui.twopart;import java.awt.*;import java.awt.event.*;public class TestChoice implements ItemListener,ActionListener{ TextField name; CheckboxGroup cg; Choice career; List city; Checkbox[] favorite; public static void main( String args[]) { new TestChoic...
awt和Sring | 2010-05-20 15:27 | 阅读 784 次 | 评论 0 条

用户注册界面设计

package com.yds.gui.fourpart;import java.awt.Button;import java.awt.Checkbox;import java.awt.CheckboxGroup;import java.awt.Choice;import java.awt.FlowLayout;import java.awt.Frame;import java.awt.GridLayout;import java.awt.Label;import java.awt.List;import java.awt.Panel;import java.awt.TextFiel...
awt和Sring | 2010-05-20 15:27 | 阅读 1317 次 | 评论 0 条

记事本界面设计

public static void main(String[] args) { Frame f=new Frame("记事本"); MenuBar mb=new MenuBar(); Menu m1=new Menu("打开"); MenuItem mi1=new MenuItem("打开"); MenuItem mi2=new MenuItem("保存"); MenuItem mi3=new MenuItem("另存为"); MenuItem mi4=new MenuItem("退出"); Monst...
awt和Sring | 2010-05-20 14:30 | 阅读 771 次 | 评论 0 条

事件处理和界面不在同一个类中的设计方法

package com.yds.gui.fourpart;import java.awt.Button;import java.awt.Frame;import java.awt.Panel;import java.awt.TextArea;import java.awt.TextField;import java.awt.event.WindowAdapter;import java.awt.event.WindowEvent;public class TextAreaBea { Frame f; TextArea ta; Button b; TextFie...
awt和Sring | 2010-05-20 14:10 | 阅读 988 次 | 评论 0 条

用户登录界面的设计

import java.awt.*;import java.awt.event.*; public class TestTextField implements ActionListener{ TextField name; TextField password; public static void main( String args[]) { TestTextField ttf = new TestTextField(); ttf.createUI(); } public void createUI(){ Frame f = new Frame("登录界面"); ...
awt和Sring | 2010-05-20 11:39 | 阅读 1416 次 | 评论 0 条

很喜欢的一篇文章

转载:被127次掌声打断的浙江大学教授郑强的经典语录1.日本人宁愿喜欢黑人,也不喜欢我们,因为现在的中国人没有了精神。2.大家都在嘲笑俄罗斯,但我知道俄罗斯将来一定会发达,因为那里的人2天没吃饭了饿着肚子还排队,而我们有2个人也要挤的不可开交。3.日本人侵犯我们,因为我们出了很多汉奸。将来日本人侵犯我们,还会不会有汉奸?谁将是未来中国的汉奸?在座的诸位很大一部分都将是。因为你们嘲笑爱国者,崇拜权势和金钱,鄙夷理想和志气。4.谁现在就是汉奸?北大清华的学生,因为用他们学习的知识帮外国人开拓市场,打败我们中国的企业5.我们漠视历史的价值,总以为楼宇越新越好,但你到法国市中心看看,几乎没有什么...
闲清屋 | 2010-05-20 10:35 | 阅读 742 次 | 评论 0 条

awt中的计算器

package com.yds.gui.threepart; import java.awt.Button;import java.awt.Frame;import java.awt.GridLayout;import java.awt.Panel;import java.awt.TextField; public class Jishuan { static Button b1, b2, b3, b4, b5, b6, b7, b8, b9; static Button b11, b12, b13,b14; public static void main(String[] ar...
网络编程 | 2010-05-20 09:43 | 阅读 1159 次 | 评论 0 条

灰色按钮的设计

package com.yds.javatalk; import java.awt.Button;import java.awt.Frame;import java.awt.Panel;import java.awt.event.ActionEvent;import java.awt.event.ActionListener; public class ButtonTest extends Frame implements ActionListener { Button b1,b; ButtonTest(){ Panel p=new Panel(); b=new Button...
网络编程 | 2010-05-19 16:21 | 阅读 1013 次 | 评论 0 条

自定义的一些标准

标准的输入格式InputStreamReader isr=new InputStreamReader(System.in); BufferedReader br=new BufferedReader(isr); 从Socket中得到的标准输出格式 PrintWriter pw=new PrintWriter(s.getOutputStream());//s为Socket对象名 从Socket中得到的标准输入格式 BufferedReader bw=new BufferedReader(new InputStreamReader(s.getInputStream())); ...
I/O编 | 2010-05-19 15:58 | 阅读 719 次 | 评论 0 条

在UDP中两方互发信息的过程

import java.io.IOException;import java.net.DatagramPacket;import java.net.DatagramSocket;import java.net.InetAddress;import java.net.SocketException;public class UdpClient { public static void main(String[] args) { try { DatagramSocket ds = new DatagramSocket(); ...
网络编程 | 2010-05-19 14:35 | 阅读 1107 次 | 评论 0 条

在别一个监听类中获得textfield的值

public void actionPerformed(ActionEvent e) { // System.out.println(); if (e.getActionCommand().equals("启动服务")) { System.out.println("已经进来了"); System.out.println(this.tf1); } // } else if (e.getActionCommand().equals("停止服务")) { // System.out.println("!!!!!!!"); // } else if (e.getActi...
网络编程 | 2010-05-18 21:39 | 阅读 713 次 | 评论 0 条
浏览275963次