JFileChooser problem - it will not display

I have read the tutorial on JFileChoosers and understand the basics, however, my application will simply not display a File Chooser. I select the menu option "open file" and the command prompt window just spews out dozens of garbage. The code is below if there are any FileChooser "Pros" out there. The FileChooser is selected for loading in the actioPerformed method. Thanks for any assistance.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import java.io.*;
import java.util.*;
import javax.swing.JFileChooser;
import javax.swing.filechooser.*;
public class DissertationInterface extends JFrame implements ActionListener
     private JPanel onePanel, twoPanel, bottomPanel;
       private JButton quit,search;
       private JMenuBar TheMenu;
       private JMenu menu1, submenu;
     private JMenuItem menuItem1;
     private JFileChooser fc;          //FILE CHOOSER
       private BorderLayout layout;
       //Canvas that images should be drew on
       //drawTheImages Dti;
       //Instances of other classes
     //DatabaseComms2 db2 = new DatabaseComms2();
     //Configuration cF = new Configuration();
       public DissertationInterface()
            setTitle("Find My Pics - University Application") ;
            layout = new BorderLayout();          
            Container container = getContentPane();
            container.setLayout(layout);
            //Dti = new drawTheImages();
          //container.add(Dti);
            quit = new JButton("Quit");
            search = new JButton("Search");
            TheMenu = new JMenuBar();
            setJMenuBar(TheMenu);
            //FILE CHOOSER
            JFileChooser fc = new JFileChooser();     
            fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
            //First menu option = "File";
            menu1 = new JMenu("File");
          TheMenu.add(menu1);
            //Add an option to the Menu Item
            menuItem1 = new JMenuItem("OPEN FILE",KeyEvent.VK_T);
        menuItem1.setAccelerator(KeyStroke.getKeyStroke(
        KeyEvent.VK_1, ActionEvent.ALT_MASK));
          menu1.add(menuItem1);
          menuItem1.addActionListener(this);          //action listener for Open file option
            //CREATE 3 PANELS
            onePanel = new JPanel();
            onePanel.setBackground(Color.blue);
            onePanel.setLayout(new FlowLayout(FlowLayout.CENTER, 200, 400)) ;
            twoPanel = new JPanel();
            twoPanel.setBackground(Color.red);
            twoPanel.setLayout(new GridLayout(5,2,5,5));
            bottomPanel = new JPanel();
            bottomPanel.setBackground(Color.yellow);
            bottomPanel.setLayout(new FlowLayout(FlowLayout.CENTER,10,10));
          //ADD COMPONENTS TO THE PANELS
            //Add the menu bar and it's items to twoPanel
          twoPanel.add(TheMenu, BorderLayout.NORTH);
          twoPanel.setAlignmentY(LEFT_ALIGNMENT);
            bottomPanel.add(quit);
            quit.addActionListener(this);          //action listener for button
            bottomPanel.add(search);
            search.addActionListener(this);          //action listener for button
            //ADD PANELS TO THE WINDOWS
            container.add(onePanel, BorderLayout.CENTER);
            container.add(twoPanel,BorderLayout.NORTH);            
            container.add(bottomPanel, BorderLayout.SOUTH);
            //setSize(350,350);
            setVisible(true);
          }//END OF CONSTRUCTOR
        public void leaveWindow()
             this.dispose() ;
        public static void main(String args[])
        DissertationInterface DI = new DissertationInterface();
        DI.setVisible(true);
        //Display the window.
        DI.setSize(450, 260);
        DI.setVisible(true);
        DI.pack();
     }//End of main method
     protected void processWindowEvent(WindowEvent e)
            super.processWindowEvent(e);
            if(e.getID()== WindowEvent.WINDOW_CLOSING)
                  System.exit(0);
          }//End of processWindowEvent
//method to resolve button clicks etc
public void actionPerformed(ActionEvent e)
          //PROBLEM IS HERE !!!!!!! - why won't the file dialogue box open
          if(e.getActionCommand().equals("OPEN"))
               int returnVal = fc.showOpenDialog(DissertationInterface.this);
             else if(e.getActionCommand().equals("Quit"))
                  //closeDialog();
                  System.out.println("User interface exited");
                  System.exit(1);
                  leaveWindow();
          else if(e.getActionCommand().equals("Search"))
                  //pass params to database                                 
             }//end of else if
} //end of method ActionPerformed
}//End of class DissertationInterface

I have done as stated, code compiles/executes but when I select the open file option on my GUI, the command prompt window freezes and no dialogue box is displayed!!!!

Similar Messages

  • IChat will not display status messages.

    I'm having a problem - iChat will not display any "available" status messages. All away messages display properly, but any unique status messages will not display, nor does the word "available". I have restarted both iChat and my MacBook several times, deleted the com.ichat.AIM preferences file, but it seems nothing I do will make my buddy's unique status messages display.
    I did not previously use Chax but downloaded it to see if it would help; it didn't. I'm willing to delete it if it will solve my problem.
    Any help?
    Thanks!
    Message was edited by: Paperclippe

    Ok,
    As you either suspected or found out the Saved Status Messages are in com.apple.ihat.plist
    The fact they didn't display would suggest that they may have become corrupted and the deletion of the .plist would have helped.
    BUT you went on to mention that the Available Choice also does not display.
    This would suggest one of two things.
    1) Either you are not fully Logged in to the AIM servers properly
    Do your Buddies see you are On-line and Available ?
    Do they perceive your Status change ?
    Can you Text chat to people ?
    Can you send files or Pic in Text chats ?
    Try Deleting com.apple.ichat.AIM.plist and restarting iChat to see if that helps
    2) Something about iChat or it's support folders (the bits that make the Available show up), that are at fault.
    In this case try deleting com.apple.ichatAgent.plist
    This controls which accounts login and help the app to run some of the features such as the Video/Audio part and Text Messaging.
    I would do these one at a time just so you know which it was that fixed it.
    8:27 PM Friday; June 20, 2008

  • Migration Assistant: Problems transferring data from PC (XP SP3) to new Mac Pro 2012 - can not get Migration Assistant to work as PC will not display verfify passcode

    Migration Assistant: Problems transferring data from PC (XP SP3) to new Mac Pro 2012 - can not get Migration Assistant to work as PC will not display verfify passcode
    Hello, I am having problems migrating data from my old PC running XP (SP3) to my new Mac Pro 2012 using the Migration Assistant.
    - I downloaded and installed the Windows Migration Assistant from Apple
    - My Mac recognized PC and displays passcode
    - The sasscode does not show / display on my PC
    - My Mac is then stuck in "authenticating" loop and the PC is stuck "waiting for Mac to connect."
    - Both computers are connected on same network (have connected PC on WIFI and using ethernet to Reuter)
    I have looked on support site and only response I saw says to reinstall Windows Migration Assistant (which I have done)
    Any ideas?  If cant get this to workare there instructions for manually bring across relevant data eg itunes music and apps, photos, picasa data etc?

    Why not turn off the Windows firewall and uninstall any other firewall software you have installed?
    If you are using a Norton product uninstall it and discard it. To fully unistall most Norton products you have to go to the Norton website and download a soecial program to completely get rid of it. The normal uninstall feature built into the program will not remove all of it.

  • The menubar will not display in full screen

    Hi.
    I have a strange problem in fullscreen mode, on my Macbook pro 15"
    I LOVE fullscreen, and infact the next macbook I will get is the 11" air because of its size and because full screen is so nice to work with.
    But I have a strange problem which I can't find a solution for.
    Suddenly the menubar will not display it self when I move the mouse to the top of the screen. The only way I can access the menu bar is by exiting full screen (ctrl + Cmd + F) and the toggel it back on after I have used the menubar
    This actually makes fullscreen mode useless and its driving me nuts, because this should not happen on Apple software. I would expect these sorts of behaviour on windows but not in osx.
    Anybody have a hint about what to do?

    https://discussions.apple.com/thread/3881124?start=0&tstart=0     <<<<< GO THERE
    Try this:  make a temporary, backup copy (if you don't already have a backup copy) of the library and try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home()/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
         User/Home()/Library/Caches/com.apple.iPhoto folder. 
    Click to view full size
    3 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.

  • I was recently sent a very large emoji message amd now when i try to acces messages it will not display mesagges and then will bring me back to the home page

    was recently sent a very large emoji message amd now when i try to acces messages it will not display mesagges and then will bring me back to the home page

    Quit the messages app and reset your phone.
    Go to the Home screen and double click the Home button. That will reveal the row of recently used apps at the bottom of the screen. Tap and hold on the app in question until it jiggles and displays a minus sign. Tap the minus sign to actually quit the app. Then tap anywhere on the screen above that bottom row to return the screen to normal. Then restart the app and see if it works normally. Then reset your device. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider should one appear until the Apple logo appears. Let go of the buttons and let the device restart.
    After the phone restarts go into Messages and delete the thread containing the problem message.

  • Firefox will not display on the screen even though with Process Explorer I see Firefox.exe active but no CPU usage

    I use Firefox v10.0.2 as default browser on Dell XPS8300 e/w Intel Core i5 & Windows 7 Ultimate and Compaq Presario CQ57 e/w Intel Core i3 & Windows 7 Home. More frequently on the (about 90% of attempts) than the Dell (50% of attempts) Firefox will not display to the screen when I click on icon. When it happens I cannot display other programs. I specifically say display because I believe Firefox has started. To circumvent the problem I installed Process Explorer on both machines and start this program first then click on Firefox icon. When problem occurs I can see Firefox.exe process in Process list; some CPU consumed but, then, no CPU activity. If I click on Firefox icon again another process opens in Process list but with same response - some CPU consumed and then no CPU activity. If I have 2 processes running and kill the 1st process, the 2nd will display and everything from then on is normal. If I do not open a 2nd process but kill the 1st process then click on Firefox icon Firefox is displayed and everything from then on is normal. This problem has occurred since original installation on both new machines. I've updated video drivers in both machines.

    Ok, let's see if we can fix this and get it working for you!
    First, if you start Firefox in [[safe mode|safe mode]] (restart your computer first, then when you open Firefox, hold down the shift key) does it start up more reliably? This is usually caused by a faulty add-on. If it does help, then restart Firefox, go into the Firefox button, then add-ons, and disable your extensions one by one until you find the trouble maker.
    Also, try updating to Firefox 11, it has several bug fixes that might make life easier here.
    Just as a few basic troubleshooting steps to make sure we have all the bases covered,
    Run all Windows Updates, install all needed service packs, etc.
    Update all your plugins (Flash, Java, etc.): [http://www.mozilla.org/plugincheck/ http://www.mozilla.org/plugincheck/].
    Download and Install MalwareBytes Anti-Malware, run a full Scan. [http://www.malwarebytes.org/ http://www.malwarebytes.org/]. This helps check that there are no viruses on your computer causing issues. you can uninstall this program after you clean off any infections.

  • Updated to the latest revision. Firefox will not display my chosen home page without clicking on home icon.

    Since latest update...Firefox will not allow a new page to be opened from a link in a current page. It will allow a new tab to be opened (with tabbed browsing checked) but i prefer a new page. Even in tabbed browsing links to things like a pdf will not work at all.
    Firefox WILL NOT close. X-ing out will close the window but I can not get back to Firefox without closing it in task manager.
    Firefox will not display my chosen home page without clicking on home icon.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Adobe Illustrator file will not display correctly when logged in as a user

    I am working with an Adobe Illustrator CS2 file that will open and display correctly if I log in as Administrator, but will not display correctly if I am logged on as a user. The error message is that there is not enough memory to display the file correctly and I am forced into preview mode. The user Home folder is on a server. Other than this, I have made certain that the criteria for opening the file match under both interfaces. I have opened the AI CS2 file on other Macs and it opens fine. I conclude that the problem is with the user Home folder, but beyond that, I'm stumped. Any help will be appreciated.

    After I filed a bug-report an Apple engineer contacted me, and asked me to try running java in headless mode: http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/
    That solved the problem!

  • Photos show up as thumbnail but when I click on them they will not display

    Photos show up as thumnails but when I click on them they will not display. I get a exclamation mark in a dotted line box

    Hylan:
    That occurs when the library has lost the link to the original file. This is a result of a damaged library database file, Library6.iPhoto. You can try rebuilding the library from within iPhoto to see if you can recover the photos by launching iPhoto with the Command+Option keys depressed and follow the instructions to rebuild the library. Select the first three options. However, it's iffy.
    You can rebuild the library with iPhoto Library Manager as it create a new library, leaving the original one intact, by reading the AlbumData.xml file and copying what it needs. You will be able to recover the photos, albums, keywords, titles and comments. However, books, slideshows, and calendars will not be recovered. Here's how:
    Using iPhoto Library Manager to Rebuild Your iPhoto Library
    1 -Download iPhoto Library Manager and launch.
    2 -Click on the Add Library button, navigate to your User/Pictures folder and select your iPhoto Library folder.
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File->Rebuild Library menu option
    4 - In the next window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: It may take some time to create the new library if you have a lot of photos. Report back on how long it took and how many photos you have in the library so we can give other users an idea of how long it may take.
    It that doesn't work you'll have to start over with a new library and import the Originals folder from the old library as follows:
    Creating a new library while preserving the Events from the original library.
    Move the existing library folder to the desktop.
    Open the library package like this.
    Launch iPhoto and, when asked, select the option to create a new library.
    Drag the Originals folder from the iPhoto Library on the desktop into the open iPhoto window.
    This will create a new library with the same Events as the original library if you have the Finder checkbox unchecked in the Events preference pane.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Cross References Will Not Display Page Number

    Got some documents created in InDesign CS3 (MAC). When bringing them into CS4 (Windows) and trying to create a paragraph cross-reference the page numbers will not display. All the other text in the cross reference ("paragraph", the word "page", etc.) displays correctly. Even the cross reference under the "hyperlinks" toolbar shows nothing (instead of the usual # indicating a page number).
    However If I copy some of the same pages into a new document and create a cross reference in it the page number displays correctly. But since it's over 300 pages I really would hate to have to do that!
    Any ideas?

    Is it maybe because CS3 does not include the cross references function (not a feature until CS4)?
    That's a real problem if we use an outside source to create a lot of our documents and they're working in a previous version.

  • Firefox will not display certain features of websites in windows 8.1

    I've upgraded to windows 8.1. Installed Firefox (now ver. 26) right away. I go to the same websites to pay bills, do work stuff etc for the past few years.
    Those websites work fine most of the time. RANDOMLY (at least to me) 2 websites have been giving me trouble for certain features:
    1. Banking website will not display my online bill pay. It does not crash, it just says "unable to display page" and for me to check my firewall etc, reload page, etc. When I go to other features for my bank, it works fine except for the bill pay.
    2. My work website has a feature to display paychecks etc. It give me the same message of "unable to display".
    Here's the weird thing: I open and close firefox a few times and the page "magically" works.
    I load the same page in IE 11 and I have the same problem.
    I load the same page in chrome 32.0.1700.107m and I never have this problem.
    I load the same pages in firefox ver. 26 on a windows 7 machine and it work just fine.
    I'm at a loss since Firefox is my primary browser and only have the other browsers for the occasional incompatibilities.
    Any ideas? I've concluded that it's a windows 8.1 issue/compatibility but would like to try other solutions before I downgrade back to windows 7.
    FYI: I've turned off windows firewall and the same issue still occurs. I've updated to the latest adobe flash, shockwave, and Java. I only have one extension installed - adblocker (which is disabled for these websites).
    Thanks in advance for any help.

    Current Firefox versions have enabled a built-in PDF Viewer that doesn't have all features that other PDF readers like the Adobe Reader have or may not function properly otherwise.
    You can change the action for Portable Document Format (PDF) from Preview in Firefox to use another application like the Adobe Reader or set to Always Ask in "Firefox > Options/Preferences > Applications".
    You can set the pdfjs.disabled pref to true on the <b>about:config</b> page to disable the build-in PDF viewer.
    You can check the value of the plugin.disable_full_page_plugin_for_types pref on the about:config page and remove the application/pdf part if present or reset the pref to the default via the right-click context menu if you want to display PDF documents in Firefox with another application (i.e. not the built-in PDF Viewer).
    See also:
    *https://support.mozilla.org/kb/view-pdf-files-firefox-without-downloading-them

  • Preview.app will not display some PDF files

    Since upgrading Yosemite I have found that Preview.app will not display some PDF documents, the documents open but all the pages are blank. This is a big issue as my work involves reviewing documents that are all in the PDF format. Strangely some PDFs work properly but I haven't been able to determine any common factors among the documents that work versus those that don't work. The problem documents do open correctly in Adobe Acrobat Reader but Reader takes over viewing of PDF container fields I have in several important FileMaker Pro 13 databases. Acrobat in the FileMaker databases for me is just as much of a problem as not viewing PDFs in Preview.
    After searching the forums I followed suggestion in a post to try using version 7.0 of Preview.app (the version that worked under Mavericks) but that is also showing blank pages. I have noticed that the PDFs which open as blank pages also display that way in Finder and Spotlight previews. Could this mean that I have some kind of OS level issue here and not a Preview.app issue? Perhaps Finder and Spotlight use Preview.app to generate the preview.
    I have posted this in a bug report to Apple but in the meantime I would welcome any suggestions or workarounds to try.

    The built-in PDF renderer has trouble with that file. You might get better results with Adobe Reader.

  • Altavista will not display search results

    altavista us will not display search results. altavista canada works fine. On us site results will display in no style page but not in basic page style. The page comes up blank. This may have been caused by delta search. I think I have rid my computer of delta? Reloaded firefox. I use norton 360 and have run registry clean up and virus scans. Also cleaned explorer. In explorer the u.s. altavista works ok that is why I think it something to do with firefox and delta search showed up at the same time unwanted and forced a change on my home page. Have cleared computer of what delta files I could find my have something in the registry but I would not know what to look for or to do with. I am running xp

    In a round about way you solved my problem cor-el ! At the end of standard diagnostic there was mention of malware so I ran malwarebytes before running profile manager. malwarebytes found 21 items some in the registry. deleted these items and tried altavista us again and to my surprise it is working ok now.I thought norton 360 would catch such things but I guess it doesn't ! will keep and run a malware program from now on. thank you for your help.

  • Itunes will not display , although task manager says it is on

    itunes will not display , although task manager says it is on, by double clicking icon, it will ask , do you want itunes to make changes, I say yes and nothing appears afterward as if it is already on but no display of itunes, so i cannot use iphone or ipad to pc

    Sounds like Firefox is "hanging at exit". That problem is frequently caused by an Extension or a Plugin. Read all of the following articles.<br /><br />
    NOTE: Establish a habit of exiting/closing Firefox with Firefox button > Exit or File > Exit to allow an orderly shutdown of Firefox and closing of all of the files that Firefox has open.
    #Stop the Firefox process:
    #*[http://kb.mozillazine.org/Kill_application Mozillazine - Kill application]
    #*Windows 7 users click [http://www.techrepublic.com/blog/window-on-windows/reap-the-benefits-of-windows-7s-task-manager/2576 here]
    #*Mac users: http://techheavy.com/2011/02/the-mac-task-manager/
    #Why Firefox may hang:
    #*[http://support.mozilla.org/en-US/kb/Firefox+hangs Firefox hangs] (see Hang at exit)
    #*[http://kb.mozillazine.org/Firefox_hangs Firefox hangs (Mozillazine)] (see Hang at exit and Closing Firefox properly)
    #*[https://support.mozilla.org/en-US/kb/Firefox+is+already+running+but+is+not+responding Firefox is already running but is not responding]
    #Use Firefox Safe Mode to find a problem with an Extension or Plugin:
    #*Don't check anything when entering Safe Mode, just continue
    #*If the problem does not occur in Safe Mode it is probably an Extension or Plugin causing the problem
    #*See:
    #**[[Safe Mode]] and [http://kb.mozillazine.org/Safe_Mode Safe Mode (Mozillazine)]
    #**[http://support.mozilla.org/en-US/kb/Troubleshooting+extensions+and+themes Troubleshooting extensions and themes]
    #**[http://support.mozilla.org/en-US/kb/Troubleshooting+plugins Troubleshooting plugins]
    #**[http://support.mozilla.org/en-US/kb/Basic+Troubleshooting Basic Troubleshooting]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • Safari will not display new domain endings on iPad

    Safari will not display new domain endings, instead goes to google, other browsers have no issue with this just safari. My domain per example ends in .photo rather than .com etc....  This is only an issue on the iPad or mobile app of safari.

    You need to check that website again, after clearing the cookies from browser. If it still unable to connect with the website having new domain names then message to Safari forum about the problem or inform them via feedback option available in browser. Hopefully they would troubleshoot this problem.

Maybe you are looking for