83 lines
4.4 KiB
HTML
83 lines
4.4 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="reference" />
|
|
<meta name="DC.Title" content="File dialogs" />
|
|
<meta name="abstract" content="" />
|
|
<meta name="description" content="" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="vifsfdlg" />
|
|
<meta name="DC.Language" content="en-us" />
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
|
<title>File dialogs</title>
|
|
</head>
|
|
<body id="vifsfdlg"><a name="vifsfdlg"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">File dialogs</h1>
|
|
<div><p></p>
|
|
<div class="section"><p>The <a href="javadoc/com/ibm/as400/vaccess/IFSFileDialog.html"> IFSFileDialog</a> class is a dialog that allows
|
|
the user to traverse the directories of the integrated file system on the
|
|
server and select a file. The caller can set the text on the buttons on the
|
|
dialog. In addition, the caller can use <a href="javadoc/com/ibm/as400/vaccess/FileFilter.html">FileFilter</a> objects, which allow the user
|
|
to limit the choices to certain files.</p>
|
|
</div>
|
|
<div class="section"><p>If the user selects a file in the dialog, use the <a href="javadoc/com/ibm/as400/vaccess/IFSFileDialog.html#GETFILENAME()"> getFileName()</a> method to get the name of
|
|
the selected file. Use the <a href="javadoc/com/ibm/as400/vaccess/IFSFileDialog.html#GETABSOLUTEPATH()"> getAbsolutePath()</a> method to get the full
|
|
path name of the selected file.</p>
|
|
</div>
|
|
<div class="section"><p>The following example sets up an integrated file system file dialog
|
|
with two file filters:</p>
|
|
</div>
|
|
<div class="section"><div class="p"><pre> // Create a IFSFileDialog object
|
|
// setting the text of the title bar.
|
|
// Assume that "system" is an AS400
|
|
// object and "frame" is a JFrame
|
|
// created and initialized elsewhere.
|
|
IFSFileDialog dialog = new IFSFileDialog (frame, "Select a file", system);
|
|
|
|
// Set a list of filters for the dialog.
|
|
// The first filter will be used
|
|
// when the dialog is first displayed.
|
|
FileFilter[] filterList = {new FileFilter ("All files (*.*)", "*.*"),
|
|
new FileFilter ("HTML files (*.HTML", "*.HTM")};
|
|
// Then, set the filters in the dialog.
|
|
dialog.setFileFilter (filterList, 0);
|
|
|
|
// Set the text on the buttons.
|
|
dialog.setOkButtonText ("Open");
|
|
dialog.setCancelButtonText ("Cancel");
|
|
|
|
// Show the dialog. If the user
|
|
// selected a file by pressing the
|
|
// "Open" button, then print the path
|
|
// name of the selected file.
|
|
if (dialog.showDialog () == IFSFileDialog.OK)
|
|
System.out.println (dialog.getAbsolutePath ());</pre>
|
|
<strong>Example</strong></div>
|
|
</div>
|
|
<div class="section"><p>Present an <a href="filedialogexample.htm#filedialogexample"> IFSFileDialog</a> and
|
|
print the selection, if any.</p>
|
|
</div>
|
|
<div class="section"><p>Figure 1 shows the IFSFileDialog graphical user interface component:</p>
|
|
</div>
|
|
<div class="section"><p><strong>Figure 1: IFSFileDialog GUI component</strong></p>
|
|
</div>
|
|
<div class="section"><p><img src="rzahh082.gif" alt="IFSFileDialog GUI component" /></p>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
</html> |