Directory highlighting in filechooser

I would like to create a filechooser similar to the one in NetBeans where directories with projects are highlighted (or painted with little yellow icon).
In my case it would be for instance the presence of any jpg files in the directory or some similar criteria.
Thanks for any help

You should ask this question over at the Swing section of this forum.

Similar Messages

  • Directory Highlighted in Red

    I'm new to OSX. What does it mean when a directory in Finder is highlighted in red?
    Cheers, Kris

    Welcome to the disc forums kvanderstarren- Is this what we are talking about?
    http://docs.info.apple.com/article.html?path=Mac/10.6/en/15236.html
    Hope this helps

  • Remote images not showing up in design/split view

    Just recently, whenever i updated the image location from the
    local site to the remote site path, the images don't get loaded
    into dreamweaver how it used to.
    i'm not sure if i unchecked something. the paths are correct
    and they show up when i preview in browser so i know it's not that.
    if anyone can help with this it will be great. thanks.

    Do you have spaces in your image file/pathnames?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "zgarcia" <[email protected]> wrote in
    message
    news:e286rc$adb$[email protected]..
    > DW 8.01
    >
    > it's not the put action.
    >
    > what i normally do is compose the email on the local
    site so i have the
    > images
    > showing, add the links etc...
    > then i upload the images onto my remote server.
    > after i do that, i go into the source code and do a
    find/replace on the
    > image
    > directory. (highlight "images" and replace it with the
    > "
    http://www.example.com/campaign/email")
    >
    > now, after i do a replace all, the images would reflect
    whatever is in the
    > remote directory (
    http://etc...) and will actually display
    in the
    > design/split
    > view instead of seeing broken image icons as it's
    currently doing.
    >
    > the remote site locations are correct.
    >
    > let me know if that helps, thanks.
    >

  • File Chooser is displaying names of the Files and Directories as boxes

    Hi All,
    Actually i am working on an application in which i have the requirement to internationalize the File Chooser in All Operating Systems. The application is working properly for all languages on MAC OS, but not working properly for the language Telugu on both the Ubuntu and Windows OS. The main problem is, when i try to open the File Chooser after setting the language to TELUGU all the labels and buttons in the File Chooser are properly internationalized but names of Files and directories in the File Chooser are displaying as boxes.
    So please provide your suggestions to me.
    Thanks in Advance
    Uday.

    I hope this can help you:
    package it.test
    import java.awt.BorderLayout;
    import java.awt.Frame;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Locale;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    * @author Alessandro
    public class Test extends JDialog {
         private JFileChooser fc = null;
         private Frame bfcParent = null;
         public Test(Frame parent, boolean modal) {
              super(parent, modal);
              this.bfcParent = parent;
              if (fc == null) {
                   fc = new JFileChooser();
                   fc.setAcceptAllFileFilterUsed(false);
                   fc.setLocale(Locale.ITALIAN);//i think you should use english
                   //these are in telugu
                   UIManager.put("FileChooser.openDialogTitleText", "Open Dialog");
                   UIManager.put("FileChooser.saveDialogTitleText", "Save Dialog");
                   UIManager.put("FileChooser.lookInLabelText", "LookIn");
                   UIManager.put("FileChooser.saveInLabelText", "SaveIn");
                   UIManager.put("FileChooser.upFolderToolTipText", "UpFolder");
                   UIManager.put("FileChooser.homeFolderToolTipText", "HomeFolder");
                   UIManager.put("FileChooser.newFolderToolTipText", "New FOlder");
                   UIManager.put("FileChooser.listViewButtonToolTipText", "View");
                   UIManager.put("FileChooser.detailsViewButtonToolTipText", "Details");
                   UIManager.put("FileChooser.fileNameHeaderText", "Name");
                   UIManager.put("FileChooser.fileSizeHeaderText", "Size");
                   UIManager.put("FileChooser.fileTypeHeaderText", "Type");
                   UIManager.put("FileChooser.fileDateHeaderText", "Date");
                   UIManager.put("FileChooser.fileAttrHeaderText", "Attr");
                   UIManager.put("FileChooser.fileNameLabelText", "Label");
                   UIManager.put("FileChooser.filesOfTypeLabelText", "filesOfType");
                   UIManager.put("FileChooser.openButtonText", "Open");
                   UIManager.put("FileChooser.openButtonToolTipText", "Open");
                   UIManager.put("FileChooser.saveButtonText", "Save");
                   UIManager.put("FileChooser.saveButtonToolTipText", "Save");
                   UIManager.put("FileChooser.directoryOpenButtonText", "Open Directory");
                   UIManager.put("FileChooser.directoryOpenButtonToolTipText", "Open Directory");
                   UIManager.put("FileChooser.cancelButtonText", "Cancel");
                   UIManager.put("FileChooser.cancelButtonToolTipText", "Cancel");
                   UIManager.put("FileChooser.newFolderErrorText", "newFolder");
                   UIManager.put("FileChooser.acceptAllFileFilterText", "Accept");
                   fc.updateUI();
         public int openFileChooser() {
              fc.setDialogTitle("Open File");
              fc.resetChoosableFileFilters();
              int returnVal = 0;
              fc.setDialogType(JFileChooser.OPEN_DIALOG);
              returnVal = fc.showDialog(this.bfcParent, "Apri File");
              //Process the results.
              if (returnVal == JFileChooser.APPROVE_OPTION) {
                   System.out.println("Hai scelto di aprire un file");
              } else {
                   System.out.println("hai annullato l'apertura");
              return returnVal;
         private static void createAndShowGUI() {
              JFrame frame = new JFrame("FileChooser");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel jp = new JPanel(new BorderLayout());
              JButton openButton = new JButton("Open File");
              final Test test = new Test(frame, true);
              openButton.addActionListener(new ActionListener() {
                   @Override
                   public void actionPerformed(ActionEvent e) {
                        test.openFileChooser();
              openButton.setEnabled(true);
              jp.add(openButton, BorderLayout.AFTER_LAST_LINE);
              //Add content to the window.
              frame.add(jp);
              //Display the window.
              frame.pack();
              frame.setVisible(true);
         public static void main(String[] args) {
              //Schedule a job for the event dispatch thread:
              //creating and showing this application's GUI.
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        //Turn off metal's use of bold fonts
                        createAndShowGUI();
    }bye ale

  • ITunes 9.1 installed - now I can't move music to my iPod

    I installed iTunes 9.1 yesterday and now I can't move any music to my ipod. The device appears in the directory listing, but any attempt to move a song, album, or playlist to it fails. The device and all of it's directory highlight in blue and no action is taken to copy.
    iTunes functions fine otherwise e.g. can import files & folders, play music, edit song info, etc.

    i have a similar problem with the 9.1 itunes drop. my 3gs says "not compatible for charging" when i connect it to my pc but it does have the charge indicator on and did seem to charge. everything sync'd to the phone (3 tv shows and 42 new songs) took 10 times as long as usual; the above took 40 minutes, it usually would have taken about 5. backing up my phone before it started to sync the content took 10 minutes. while device connected, itunes is very unresponsive.

  • Odd Finder Behaviour - blank file list

    When I open Finder I see the list of favourites on the LHS of the window with my user directory highlighted in blue at the top.  In right hand pane, where I expect to see a list of directories, I just see a blank (white) pane.  In order to "reveal" the list of files and directories I have to mouse click in the blank area and the list of files and directories appears.
    If I click on one of the other favourites in the list on the LHS of the finder window the behaviour is normal - i.e. I can see the list of files and directories on the RHS, but when I click on my user directory in the LHS, once again the RHS is blank until I mouse click inside it. 
    Is this normal behaviour?  Finder didn't behave like this with 10.6.
    MBA 13
    10.7.4
    2 GHz Intel I7
    8GB RAM
    Thanks in advance for any help/advice.
    49

    Here the Screenshots:

  • New FileChooser doesn't allow choosing a directory?

    Am I just missing something obvious? The new javafx.stage.FileChooser class (beta build 36) doesn't seem to allow the user to choose a directory. I.e., I can select a directory in the dialog and click the 'open' button, but it just takes me into that directory within the dialog.
    I'm using Windows 7, Java 7 and beta build 36.

    I suggest you file an RFE on the Jira about expanding the FileChooser API to allow directory selection. But I found that windows user always end beign very confused when presented with a file chooser dialog to select... a directory... It's better to have a tree or list base directory chooser instead.
    The fact that we do not have a directory chooser at hand is a longstanding Swing issue (made an RFE in the early 2000s about that - was replied "use JFileChooser instead", :/). One was supposed to be integrated in SwingX and with future consideration for Swing integration (Romain Guy, Swing Team, circa 2004~2005), it seems it never happened.
    In JavaFX 1.3 for some time I've used a third party Swing control that used to do that and after a while I've built a prototype one using ListView and TreeView (but as you know unfortunatly TreeView was not working great in those days) + there's always the matter of the weird tree structure you end up with on Windows (with desktop as the root of everything which makes properly expanding the tree to show initial selection difficult - especially since the base nodes bear i18n names). Anyway, as of 2011, we're still missing a proper directory view.
    When/if time allows at my job (and it looks unlikely these days), I'll file a couple of RFE about providing FileView and DirectoryView (with Tile, List, Table and Tree display) and reworking their FileChooser.ExtensionFilter API (already mentionned in another message) so we can at least finally have a proper control to browse through a file system, build file dialog or even a file browser...

  • What is the significance of the blue, green and grey highlighted names in the directory used to text or iMessage? This is not about the messaging themselves, but the names to select to text or iMessage.

    What is the significance of the blue, green and grey highlighted names in the directory used to text or iMessage? This is not about the messaging themselves, but the names to select to text or iMessage.

    The entries in blue are people you've recently exchanged iMessages with, the ones in green are people with whom you've recently exchanged SMS messages and the ones in grey are people with whom you have not recently exchanged any messages.

  • Changing FileChooser directory.

    Hello!
    Does anybody have an idea how to change a directory
    which FileChooser show by default . (home directory in my case). And i want it to show me a directory where my java files are.
    Thank you !

    hi..
    JFileChooser chooser = new JFileChooser("some dir.");
        int returnVal = chooser.showOpenDialog(parent);
        if(returnVal == JFileChooser.APPROVE_OPTION) {
           System.out.println("You chose to open this file: " +
                chooser.getSelectedFile().getName());
    you could use getProperty(user.home); or something like that.. to get the current home dir of the user
    Sander

  • FileChooser and Directory Issue

    I am using FileChooser and I want user to select only directory.
    So for that i have chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    I am having the problem like when user selects the directory C:\docs\api.
    But when I am calling the File newDir = chooser.getCurrentDirectory();
    it is taking as only C:\docs , but I want the C:\docs\api.
    How I can achive this?

    If you don't get any useful replies soon, then your best bet here is to show us your code. We don't want to see all of it, but rather you should condense your code into the smallest bit that still compiles, has no extra code that's not relevant to your problem, but still demonstrates your problem, in other words, an SSCCE (Short, Self Contained, Correct (Compilable), Example). For more info on SSCCEs please look here:
    [http://homepage1.nifty.com/algafield/sscce.html|http://homepage1.nifty.com/algafield/sscce.html]
    Remember, the code must be compilable and runnable for many of us to be able to understand it fully.
    Good luck!

  • Choose a directory with FileChooser (or otherwise) ?

    Hello,
    Is there a way to use the FileChooser (or another JavaFX 2.0) class to be able to select a folder ?
    I did find an issue in Jira, but the fix suggested there crashes the MacOS X beta of JavaFX: http://javafx-jira.kenai.com/browse/RT-15070?focusedCommentId=96034#comment-96034
    Thanks,
    Joachim Haagen Skeie
    Edited by: Joachimhs on Nov 8, 2011 3:10 PM

    Timely question. There isn't one yet, but it is scheduled for 2.1 release early next year. The proposed API:
    void setTitle(String value);
    String getTitle();
    StringProperty titleProperty();
    void setInitialDirectory(File value);
    File getInitialDirectory();
    ObjectProperty<File> initialDirectoryProperty();
    File showDialog(Window ownerWindow);

  • I would like to propose sites when i type a letter in the addressbar WITHOUT highlighting it, help me ?

    Hello :)
    I am very happy when the Firefox browser suggests me sites I have already visited, when I just type one letter in the address bar, but I don't like that this letter gets highlighted in all the suggested urls,
    I'd like Firefox always to offer me these suggestions, but if possible without highlighting the letter I type, and I don't know if I can (or how to if I can) change the settings of my browser to be so,
    Can you please help me with that?
    Thanks in advance :)

    The involved CSS code can be found in this file that you can open via the location bar.
    * chrome://global/skin/autocomplete.css
    Look for class .ac-emphasize-text and apply modified rules as you like.
    You need to add the !important flag to override rules.
    Add code to the <b>userChrome.css</b> file below the default @namespace line.
    *http://kb.mozillazine.org/userChrome.css
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    @namespace html url("http://www.w3.org/1999/xhtml");
    html|span.ac-emphasize-text {
    box-shadow: none!important;
    background-color: transparent !important;
    border-radius: 0px;
    text-shadow: none !important;
    </nowiki></pre>
    The customization files userChrome.css (user interface) and userContent.css (websites) are located in the <b>chrome</b> folder in the Firefox profile folder.
    *http://kb.mozillazine.org/Editing_configuration
    You can use this button to go to the currently used Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)
    * Create the chrome folder (lowercase) in the <xxxxxxxx>.default profile folder if this folder doesn't exist
    * Use a plain text editor like Notepad to create a (new) userChrome.css file in this folder (the names are case sensitive)
    * Paste the code in the userChrome.css file in the editor window and make sure that the userChrome.css file starts with the default @namespace line
    * Make sure that you select "All files" and not "Text files" when you save the file via "Save file as" in the text editor as userChrome.css. Otherwise Windows may add a hidden .txt file extension and you end up with a not working userChrome.css.txt file

  • Displaying the path of the file selected by a FileChooser in a TextField

    I'm just getting started with Swing. I developed a simple dialog box that has two text fields and two buttons. The objective is to open two files using those two buttons. I used FileChooser to select the files. Now, I want to display the path of the selected files in their corresponding TextFields. I use the following code to do that.
    final FileChooser fc1 = new FileChooser();
    final FileChooser fc2 = new FileChooser();
    final TextField tf1 = new TextField();
    final TextField tf2 = new TextField();
    private void button1ActionPerformed(ActionEvent evt)
                int returnVal1 = fc1.showOpenDialog(labelPhpFile);
                if (returnVal1 == JFileChooser.APPROVE_OPTION)
                    File file1 = fc1.getSelectedFile();
                    String fileName1 = file1.getName();               
                    String filePath1 = file1.getPath();
                    tf1.setText(filePath1);
    private void button2ActionPerformed(ActionEvent evt)
                int returnVal2 = fc2.showOpenDialog(labelPhpFile);
                if (returnVal2 == JFileChooser.APPROVE_OPTION)
                    File file2 = fc2.getSelectedFile();
                    String fileName2 = file2.getName();               
                    String filePath2 = file2.getPath();
                    tf2.setText(filePath2);
    }The above code works fine only for the first file. Mean the path of the file selected using fc1 is getting displayed in the tf1 TextField. But, the file selected using fc2 is not getting displayed tf2 TextField. Please help me.
    Thank you :)

    h1. The Ubiquitous Newbie Tips
    * DON'T SHOUT!!!
    * Homework dumps will be flamed mercilessly.
    * Have a quick scan through the [Forum FAQ's|http://wikis.sun.com/display/SunForums/Forums.sun.com+FAQ].
    h5. Ask a good question
    * Don't forget to actually ask a question. No, The subject line doesn't count.
    * Ask once
        - Don't Crosspost!
        - Two people answering one question independantly is a waste of there time.
    * Don't even talk to me until you've:
        (a) [googled it|http://www.google.com.au/] and
        (b) looked it up in [Sun's Java Tutorials|http://java.sun.com/docs/books/tutorial/] and
        (c) read the relevant section of the [API Docs|http://java.sun.com/javase/6/docs/api/index-files/index-1.html] and maybe even
        (d) referred to the JLS (for "advanced" questions).
    * [Good questions|http://www.catb.org/~esr/faqs/smart-questions.html#intro] get better Answers. It's a fact. Trust me on this one.
        - Lots of regulars on these forums simply don't read badly written questions. It's just too frustrating.
          - FFS spare us the SMS and L33t speak! Pull your pants up, and get a hair cut!
        - Often you discover your own mistake whilst forming a "Good question".
        - Many of the regulars on these forums will bend over backwards to help with a "Good question",
          especially to a nuggetty problem, because they're interested in the answer.
    * Improve your chances of getting laid tonight by writing an SSCCE
        - For you normal people, That's a: Short Self-Contained Compilable Example.
        - Short is sweet: No-one wants to wade through 5000 lines to find your syntax errors!
        - Often you discover your own mistake whilst writing an SSCCE.
        - Solving your own problem yields a sense of accomplishment ;-)
    h5. Formatting Matters
    * Post your code between a pair of &#123;code} tags
        - That is: &#123;code} ... your code goes here ... &#123;code}
        - This makes your code easier to read by preserving whitespace and highlighting java syntax.
        - Copy&paste your source code directly from your editor. The forum editor basically sucks.
        - The forums tabwidth is 8, as per [the java coding conventions|http://java.sun.com/docs/codeconv/].
          - Indents will go jagged if your tabwidth!=8 and you've mixed tabs and spaces.
          - Lines longer than 80 characters should be wrapped.
          - Proper indentation illustrates program logic.
    * Post your error messages between a pair of &#123;code} tags:
        - That is: &#123;code} ... errors here ... &#123;code}
        - To make it easier for us to find, Mark the erroneous line(s) in your source-code. For example:
            System.out.println("Your momma!); // <<<< ERROR 1
        - Note that error messages are rendered basically useless if the code has been
          modified AT ALL since the error message was produced.
        - Here's [How to read a stacktrace|http://www.0xcafefeed.com/2004/06/of-thread-dumps-and-stack-traces/].
    * The forum editor has a "Preview" pane. Use it.
        - If you're new around here you'll probably find the "Rich Text" view is easier to use.
        - WARNING: Swapping from "Plain Text" view to "Rich Text" scrambles the markup!
        - To see how a posted "special effect" is done, click reply then click the quote button.
    If you (the newbie) have covered these bases *you deserve, and can therefore expect, GOOD answers!*
    h1. The pledge!
    We the New To Java regulars do hereby pledge to refrain from flaming anybody, no matter how gumbyish the question, if the OP has demonstrably tried to cover these bases. The rest are fair game.

  • Open files from a specific directory

    Dear all,
    I have the following source code that simply selects files from a directory.
    private void openFile()
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setFileSelectionMode(
    JFileChooser.FILES_ONLY );
    int result = fileChooser.showOpenDialog( this );
    // user clicked Cancel button on dialog
    if (result == JFileChooser.CANCEL_OPTION )
    return;
    File filename = fileChooser.getSelectedFile();
    if (filename == null || filename.getName().equals( "" ))
    JOptionPane.showMessageDialog( this,
    "Invalid File Name",
    "Invalid File Name", JOptionPane.ERROR_MESSAGE );
    else
    // open the file
    try
         // Open an input stream
         FileInputStream fin1 = new FileInputStream(filename);
    // Read and print a line of text
    BufferedReader d1 = new BufferedReader(new InputStreamReader(fin1));
    abs = d1.readLine();
    outputArea1.setText("");
    outputArea1.append(abs + "\n\n");
    outputArea1.setCaretPosition(0);
    // Close our input and output stream
    fin1.close();
    catch (IOException e5) {
    JOptionPane.showMessageDialog(this, "Error Opening File", "Error", JOptionPane.ERROR_MESSAGE);
    } // end catch
    } // end else
    } // end private
    My question is: Can I force it to open files from a specific directory, and NOT from MyDocuments directory????
    thanks,
    vxc

    \r = return
    \n = linefeed
    \j = illegal escape character
    JFileChooser fileChooser = new JFileChooser("C:\j2sdk1.4.2\bin");
    You could/should use:
    (new File).pathSeparator
    or
    (new File).pathSeparatorChar
    and
    (new File).separator
    or
    (new File).separatorChar
    http://java.sun.com/j2se/1.4.1/docs/api/java/io/File.html

  • Error while creating back up directory ....

    My TM has been working flawlessly for a year or so, but suddenly it is very slow to mount and I get a message saying "Unable to Complete Back Up. An Error Occurred While Creating a Back Up Directory." What do I do now? (Have tried rebooting. Unplugging.)

    garagecapital wrote:
    It's a 500 Time Machine, I think.
    This is a bit confusing. Do you have an external disk drive, connected directly to your Mac via a Firewire or USB cable; or do you have a Time Capsule? We need to be sure, as the difference is very important.
    When I highlight the external drive and hit repair, it says it cannot be unmounted and does nothing. When I try without it mounted, it does not appear in the disk repair box to repair.
    Most likely, it can't be unmounted because some other process is trying to use it.
    As posted, turn TM off.
    Exclude it from any anti-virus scanning.
    Also exclude it from Spotlight indexing, via System Preferences > Spotlight > Privacy.
    If it's a Time Capsule, can you mount the Sparse Image? If so, drag that into the sidebar of Disk Utility, select +*First Aid+* then +*Repair Disk.+*

Maybe you are looking for

  • IDOC inbound: delivery confirm - set storage location at position

    Hi all, I have the issue to set with an inbound IDOC for shipping confirmation the storage location on item level. We are working with an external logistic provider so the final storage location where the goods are taken from is not not at creation t

  • Urgent - How to Run a FM using CATT script tool,

    Hi All, How to Run a FM using CATT script tool, Thanks in advance, KSR

  • Finder loses location when switching views

    Hi, In Finder if I'm viewing a network drive (Linux share via SMB) and switch from column view to icon view when I switch back to loses the location and takes me right back to the list of shares on that server. This only started since upgrading to Li

  • Reinstall 10.7 prior to sale, not available from apple store

    Hi all I am going to sell my macbook air and replace with a new one.  I want to wipe the hard drive - which I have managed to do I want to reinstall Mac OS X Lion I follow the instruction to get to the "download from the app store" I sign in with no

  • Send a file to client

    Hi! I have to send a byte array as a file to the browser. How do I convert byte[] into a resource-type context node, so it can be downloaded? Thanks!