`
文章列表

合并map

----合并map---------------------      Map map1=new HashMap();            Map map2=new HashMap();            Map map3=new HashMap();            map1.put("1", "aa");            map1.put("2", "aa");            map2.put("1", "aa");            map ...
   1. import java.util.*;     2. import org.dom4j.*;     3.      4. public class testxml {     5.      6.     public static void main(String[] args) {     7.         String xml =      8.             " <file>                                " +      9.             "     < ...
Java进度条JProgressBar使用方法 package swimg; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLab ...
set WshShell = WScript.CreateObject("WScript.Shell") strRoot = WshShell.ExpandEnvironmentStrings("%******%") WshShell.Exec strRoot+"\jre\bin\javaw -jar "+strRoot+"\client\123.jar" 2.用vbs调用bat set WshShell = CreateObject("WScript.Shell") cmd=WshShe ...
public double getCount(String str, String sign) { // 查找某一字符串中str,特定子串sign的出现次数 if (str == null) return 0; double i = str.length(); str = str.replaceAll(sign, "");// 反串中的字符sign替换成"" return (i - str.length()) / sign.length(); } ...
使用dom4j操作XML文件

FileManager

文件管理类 对文件进行读写操作

FindZipFileHelper

该方法主要在一个压缩包文件中查找指定的文件
package GoodSrc; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.Output ...

VC删除文件夹

void DeleteDirectory(CString strDir) { if(strDir.IsEmpty()) return; // 首先删除文件及子文件夹 CFileFind ff; BOOL bFound = ff.FindFile(strDir+"\\*", 0); while(bFound) { bFound = ff.FindNextFile(); if(ff.GetFileName()=="." ...
import java.io.*; import java.nio.channels.*; public class LockFile { public LockFile() { } public static void main(String[] args) throws Exception { RandomAccessFile raf = new RandomAccessFile(new File("c:\\test.txt"), "rw"); FileChannel fc = raf ...
   1.  import javax.swing.JFrame;      2. import javax.swing.JRadioButton;      3. import javax.swing.JLabel;      4. import javax.swing.BoxLayout;      5. import javax.swing.ButtonGroup;      6. import java.awt.Container;      7. import java.awt.event.ActionListener;      8. import java.awt.e ...
package org.moon.admin; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ButtonGroup; import javax.swing.JFrame; import javax.swing.JRadioButton; public class JRadioButtonTest {        // 视图组件初始化     private static JFrame f = ...
解决办法,重写下列方法: Java:    public boolean getScrollableTracksViewportWidth() {         return false;     }     public void setSize(Dimension d) {         int parentWidth = this.getParent().getWidth();         if(parentWidth>d.width){             d.width = parentWidth;         }         super.setSize( ...
[url][/url] package components; /* * TableRenderDemo.java requires no other files. */ import javax.swing.DefaultCellEditor; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.Abstra ...
Global site tag (gtag.js) - Google Analytics