摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.IO;namespace FileReadWriteDemo{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } //遍历文件 - 浏览按钮 priva 阅读全文
posted @ 2012-12-24 17:41 Entropy_lxl 阅读(19409) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;namespace ConsoleApplication1{ class Program { public static void Main() { string[] s = { "c:\\", "d:\\", "e:\\", "f:\\" }; using (StreamWriter sw = new StreamWri 阅读全文
posted @ 2012-12-24 17:40 Entropy_lxl 阅读(543) 评论(0) 推荐(0) 编辑
摘要: 添加form的FormClosing事件 /// <summary> /// 主窗口自带的关闭按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { DialogResult result; result = MessageBox. 阅读全文
posted @ 2012-12-23 17:07 Entropy_lxl 阅读(735) 评论(0) 推荐(0) 编辑
摘要: /*评论超连接*/ LinkLabel llb = new LinkLabel(); //llb.Links[0].LinkData = "http://www.163.com"; llb.Text = "评论"; llb.AutoSize = true; llb.Location = new Point(270, 100 + i * 90); this.panel1.Controls.Add(llb); //注册标签的三个事件 llb.MouseLeave += new System.EventHandler(this.mouseLeave); llb 阅读全文
posted @ 2012-12-23 12:24 Entropy_lxl 阅读(4314) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingLogHandler;usingSystem.Threading;namespaceConsoleApplication5{classProgram{privatestaticList<string>lstShare=newList<string>();staticvoidMain(string[]args){Threadth1=newThread(thread1);th1.Start();Threadth2=newThread(threa 阅读全文
posted @ 2012-12-22 10:17 Entropy_lxl 阅读(7330) 评论(0) 推荐(0) 编辑
摘要: 一.创建表格控件的各种方式:1)调用无参构造函数.JTable table = new JTable();2)以表头和表数据创建表格.Object[][] cellData = {{"row1-col1", "row1-col2"},{"row2-col1", "row2-col2"}};String[] columnNames = {"col1", "col2"};JTable table = new JTable(cellData, columnNames);3)以表头和 阅读全文
posted @ 2012-12-19 15:54 Entropy_lxl 阅读(34624) 评论(0) 推荐(1) 编辑
摘要: import java.awt.event.KeyEvent;import java.awt.event.KeyListener;import javax.swing.JFrame;/** To change this template, choose Tools | Templates* and open the template in the editor.*/import javax.swing.JPanel;import javax.swing.JTextField;/**** @author李效伦*/public class HOHO extends JFrame implement 阅读全文
posted @ 2012-12-13 12:48 Entropy_lxl 阅读(1682) 评论(0) 推荐(0) 编辑
摘要: JFame.setIconImage(Toolkit.getDefaultToolkit().creatImage(fileName));fileName是String类型,是图片文件的名字及路径 阅读全文
posted @ 2012-12-13 10:56 Entropy_lxl 阅读(318) 评论(0) 推荐(0) 编辑
摘要: JLabel background = new JLabel(new ImageIcon(url));//url代表你图片的路径this.add(background)即可//将你的jlabel背景加到jframe上当然jframe也有专门的设置背景的复方法,忘掉了,你查一下最好下一个JDK -API手册,一查便知 阅读全文
posted @ 2012-12-13 10:55 Entropy_lxl 阅读(7987) 评论(0) 推荐(0) 编辑
摘要: File musicFile=new File("所要添加的音乐名");URI uri=musicFile.toURI();URL url=uri.toURL():AudioClip=Applet.newAudioClip(url);控制音乐的播放与停止clip.play();clip.stop(); 阅读全文
posted @ 2012-12-13 10:54 Entropy_lxl 阅读(2001) 评论(0) 推荐(0) 编辑