<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98275</guid>
        <pubDate>Wed, 18 Sep 2002 16:22:04 +0000</pubDate>
        <title>Есть проблемы использованием JFileChooser (Filer)</title>
        <link>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98275</link>
        <description><![CDATA[iskander: Ну да, все именно так. А то выражение проверяет выбрано ли что-то вообще, или же совершено какое другое действие. К примеру, смена текущей директории -- это ведь тоже действие...]]></description>
        <author>iskander</author>
        <category>Java</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98274</guid>
        <pubDate>Wed, 18 Sep 2002 04:36:17 +0000</pubDate>
        <title>Есть проблемы использованием JFileChooser (Filer)</title>
        <link>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98274</link>
        <description><![CDATA[v: Возможно я чего-то не понял. Но разве выражение &quot;files.length &gt; 0&quot; определяет отличие файла от директории? Ведь это определятеся методом &quot;theFile.isDirectory())&quot;. А в цикле лишь формируется список, если пользователь выбрал несколько файлов (и директорий).<br>Я чего-то недогоняю?]]></description>
        <author>v</author>
        <category>Java</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98273</guid>
        <pubDate>Sat, 17 Aug 2002 13:39:08 +0000</pubDate>
        <title>Есть проблемы использованием JFileChooser (Filer)</title>
        <link>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98273</link>
        <description><![CDATA[iskander: Блин, это же гениально! :<br><div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">File [] files = chooser.getSelectedFiles();&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (files != null &amp;&amp; files.length &#62; 0) {&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;String filenames = &quot;&quot;;&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for (int i = 0; i &#60; files.length; i++) {&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;filenames = filenames + &quot;\n&quot; + files[i].getPath();&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;JOptionPane.showMessageDialog(frame,&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;You chose these files: \n&quot; + filenames);&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;File theFile = chooser.getSelectedFile();&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (theFile != null) {&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (theFile.isDirectory()) {&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;JOptionPane.showMessageDialog(frame,&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;You chose this directory: &quot; +&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;theFile.getPath());&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;JOptionPane.showMessageDialog(frame,&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;You chose this file: &quot; +&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;theFile.getPath());&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}&#60;br&#62; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br><br>Я правильно понимаю что вся фишка в различении файла и директории именно в &quot;files.length &gt; 0&quot;? Воистину, все гениальное просто. А я-то голову ломал как это седлать... Уж до того додмуался, что начал искать другие обработчики... Ха-ха-ха...<br>Правда, есть еще одна проблемка -- как мне заставить обработчик вернуть выбранный файл в ту подпрограмму, из которой вызывался класс, реализующий файл-чузер? Единственное, что приходит в голову -- глобальные переменные, адреса которых кочуют из одной подпрограммы в другую... :o<br>Ладно, прорвемся! :-)<br>Еще раз благодарю.]]></description>
        <author>iskander</author>
        <category>Java</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98272</guid>
        <pubDate>Sat, 17 Aug 2002 13:19:28 +0000</pubDate>
        <title>Есть проблемы использованием JFileChooser (Filer)</title>
        <link>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98272</link>
        <description><![CDATA[iskander: Большое спасибо. Скачал. Сейчас буду разбираться. Надеюсь, что проблем не возникнет. Еще раз сенкс.]]></description>
        <author>iskander</author>
        <category>Java</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98271</guid>
        <pubDate>Sat, 17 Aug 2002 12:38:45 +0000</pubDate>
        <title>Есть проблемы использованием JFileChooser (Filer)</title>
        <link>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98271</link>
        <description><![CDATA[Ankor01: вот тут у меня лежит демка c:\j2sdk1.4.0\demo\jfc\FileChooserDemo\src\ как юзать файл чузер.<br>вроде работает без проблем...<br>если у тебя этого добра нет то скачай тут<br>http://211.63.97.25/TestJFileChoser.zip<br>я его спец для тебя вырезал<br>хотя может я не понял когда у тебя возвращает нул ...]]></description>
        <author>Ankor01</author>
        <category>Java</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98270</guid>
        <pubDate>Sun, 21 Jul 2002 07:25:46 +0000</pubDate>
        <title>Есть проблемы использованием JFileChooser (Filer)</title>
        <link>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98270</link>
        <description><![CDATA[iskander: Ладно. посатвим вопрос иначе: как можно вытащить из Felre&quot;а в обработчики только выбранный файл, чтобы он не срабатывал на прочие действия юзера (кроме отмены, конечно :D)? На этот-то вопрос кто-нибудь ответить может. или ссылоччку порекомендовать...]]></description>
        <author>iskander</author>
        <category>Java</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98269</guid>
        <pubDate>Thu, 18 Jul 2002 08:58:23 +0000</pubDate>
        <title>Есть проблемы использованием JFileChooser (Filer)</title>
        <link>https://forum.sources.ru/index.php?showtopic=10568&amp;view=findpost&amp;p=98269</link>
        <description><![CDATA[iskander: В общем, никак не получается развести обработчики событий для Filer, когда пользователь просто меняет директорию и когда он выбирает файл. Итог -- выбранный файл стабильно имеет значение Null. :-(<br>Кто знает как этого избежать, подскажите, плиз.]]></description>
        <author>iskander</author>
        <category>Java</category>
      </item>
	
      </channel>
      </rss>
	