<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'help: jComboBox' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'help: jComboBox' posted on the 'Java' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sun, 26 May 2013 01:35:48 -0700</pubDate>
    <lastBuildDate>Sun, 26 May 2013 01:35:48 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>help: jComboBox</title>
      <link>http://www.programmersheaven.com/mb/java/355768/355768/help-jcombobox/</link>
      <description>hi guys....wanna make sure my code is alright:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
i have a drop down menu with items to select being the names of eiles available in a directory. after hard search i implemented this code by adding some code lines to the templated constructor of JFrame: note that am working using netbeans 5.5:&lt;br /&gt;
&lt;br /&gt;
public class NewJFrame extends javax.swing.JFrame {&lt;br /&gt;
    &lt;br /&gt;
    /** Creates new form NewJFrame */&lt;br /&gt;
    public NewJFrame() {&lt;br /&gt;
        initComponents();&lt;br /&gt;
        String curDir = System.getProperty("user.dir");&lt;br /&gt;
        jTextArea1.setText(curDir);&lt;br /&gt;
        File dir = new File(curDir);&lt;br /&gt;
    &lt;br /&gt;
        String[] children = dir.list();&lt;br /&gt;
        if (children == null) {&lt;br /&gt;
            // Either dir does not exist or is not a directory&lt;br /&gt;
        } &lt;br /&gt;
        else {&lt;br /&gt;
            for (int i=0; i&amp;lt;children.length; i++) {&lt;br /&gt;
            // Get filename of file or directory&lt;br /&gt;
                String filename = children[i];&lt;br /&gt;
                if (filename.indexOf(".txt")!=-1)&lt;br /&gt;
                    jComboBox1.addItem(filename);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
i am running the program and until now no errors appear however i think entering a directory can be done in a more efficient way especially if a large number of files exist. who may help me thinking about an alternative solution?&lt;br /&gt;
&lt;br /&gt;
thanks&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/java/355768/355768/help-jcombobox/</guid>
      <pubDate>Sat, 10 Mar 2007 11:25:09 -0700</pubDate>
      <category>Java</category>
    </item>
  </channel>
</rss>