JAVA目录选择框的解决办法
FileDialog只能选择文件而不能选择文件夹。JFileChooser又太大,不太好看,鼓捣了好一会终于解决了。
记录一下关键部分代码,以备查用。
final JButton choose=new JButton("选择存储文件目录");
final JTextField dir=new JTextField();
final JFileChooser chooser=new JFileChooser();
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
choose.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent event){
int returnValue=chooser.showOpenDialog(SearchFrame.this);
if (returnValue==JFileChooser.APPROVE_OPTION) {
File file=chooser.getSelectedFile();
dir.setText(file.getAbsolutePath());
path=file.getAbsolutePath();
}else {
JOptionPane.showMessageDialog(null, "请手动输入目录");
return;
}
}
相关文档:
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--每页显示记录条数
@currentpage int output,--第几页
@orderid nvarchar(50),--主键排序
@sort int,--排序方式,1表示升序,0表示降序排列
......
一:准备 www.savarese.org download
1. rocksaw-1.0.0-src.tar.gz
2. vserv-tcpip-0.9.2-src.tar.gz
二:编译源文件得到jar包 使用Ant
1. build vserv-tcpip-0.9.2-src
在vserv-tcpip-0.9.2目录下面建一个tests目录,然后在cmd窗口下进入 ......
1.提前写好备份.bat,放在某个文件夹里,将路径设置在.properties里的
@echo off
set txt=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%
echo %txt%
echo --------------------------------------------------
echo -------------正在执行oracle数据库备份--------------
echo ----- ......
//导出
String mysql="mysqldump -uroot -proot --opt databasename > d:/test.sql";
java.lang.Runtime.getRuntime().exec("cmd /c "+mysql);
//导入
String mysql="mysqladmin -uroot -proot create databasename";
java.lang.Runt ......