- 浏览: 102444 次
- 性别:
- 来自: 杭州
最新评论
文章列表
package stream.demo1;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
public class TransferTo
{
/**
* 相对于ChannelCopy,该方法具有更好的效率
*/
public static void main(String[] args)
t ...
1,我就是我,不想否认自己的感情,如果连自己都接受不了自己,那么你怎么能够相信别人能够接受你。所以痛就说出来,伤就说出来,恨,老实说没有必要,最好的办法是远离让你不舒服的人。其实人没有好坏,只是人与人存在一起,才出现了好坏,不要去抱怨,不要去憎恨,真的是没有必要,因为累的只有自己。
2,当意识和潜意识能够和谐统一时,人应该去学会感激,因为生活充满了矛盾,造成了意识和潜意识总是充满了矛盾,而两者的统一能够让人真正的放松下来。
3,设计模式很重要,但是在编程初期不重要,如果设计模式在干扰着你的编程,那么最好的方法的先把所有的设计模式都抛弃掉,等把模块开发出来了再去考虑设计模式的问题。 ...
package stream.demo1;
import java.io.IOException;
import java.io.RandomAccessFile;
/** 文件操作类,游离于IO树形结构外,类似DataInputStream和DataOutputStream 的集成类 */
public class UsingRandomAccessFile
{
static String file = "rtest.dat";
static void display()
throws IOExceptio ...
Stream-->Directory
- 博客分类:
- java基础
public class Directory
{
public static File[] local(File dir, final String regex)
{
// 获取当前路径下的子路径
return dir.listFiles(new FilenameFilter()
{
private Pattern pattern = Pattern.compile(regex);
public boolean accept(File dir ...
package stream.demo1;
import java.io.File;
import java.io.FilenameFilter;
import java.util.Arrays;
import java.util.regex.Pattern;
public class DirList
{
public static void main(String[] args)
{
File path = new File(".");
String[] list;
if (arg ...
package utils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
/**
* 读取
* <ul>
* <li>x ...
FrameImageDemo
- 博客分类:
- swing
public class FrameImageDemo extends JFrame
{
private static final long serialVersionUID = 1L;
private DrawSub sines = new DrawSub();
private JSlider adjust = new JSlider();
private JProgressBar progressBar = new JProgressBar();
public FrameImageDemo() ...
FrameMessageboxDemo
- 博客分类:
- swing
public class FrameMessageboxDemo extends JFrame
{
private static final long serialVersionUID = 1L;
private JButton[] b = {new JButton("确认"), new JButton("警告"), new JButton("爱好"), new JButton("录入爱好"),
new JButton(&qu ...
FrameTreeDemo2
- 博客分类:
- swing
private void expandAll(JTree tree, TreePath parent, boolean expand)
{
DefaultMutableTreeNode node = (DefaultMutableTreeNode)parent.getLastPathComponent();
if (node.getLevel() <= 1)// 代表着什么 ?
{
if (node.getChildCount() >= 0)
{
...
package filechooser;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Enumeration;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel; ...
/** 设置是否可更改 */
public boolean isCellEditable(int rowIndex, int columnIndex)
{
if (columnIndex < 2)
{
return false;
}
else
{
return true;
}
}
...
package filechooser;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swin ...
package filechooser;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
impor ...
package filechooser;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JSlider;
import javax.swing.event.ChangeEvent;
...
package filechooser;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
...