JFileChooser doesn't have focus first time it opens

Hi!
I'm using JFileChooser to export some data from JDeveloper to a file. Everything is working file, The only problem I have is, when I run the application and try to export data the choose file dialog opens behind the browser window. This is quite unpleasant since the user thinks the dialog is not opened at all. This only happens the first time when the button to export the data is clicked after the application is run. Every next time the dialog gets the focus and is visible in front of the browser.
How can I set the focus to dialog the first time it opens?
My code looks like this:
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        loJFC = new JFileChooser();
        loJFC.setDialogTitle("Export data");
        loJFC.setFileFilter(new TextFilter()); // my class that accepts only txt files
        loJFC.setAcceptAllFileFilterUsed(false);
        loJFC.setSelectedFile(new File("MyFileName.txt")); // set the default name
        int liRetVal = loJFC.showSaveDialog(null);
        if (liRetVal == JFileChooser.APPROVE_OPTION)
          loFile = loJFC.getSelectedFile();
        else
          return;
// then I write to file etc...Thanks in advance.
BB

Hi Frank!
I have a jspx page in my web application. This jspx includes a commandButton which has above described method as actionListener. So when I click on this button on the jspx the dialog for file selection is opened but hidden the first time it opens.
Thanks

Similar Messages

  • My iPod touch 4th gen white's home button doesn't work the first time I press it, but the second time.

    My home button doesn't work the first time I press it, but the second time.  This is very annoying.  Why is it doing this?

    - Try a reset. It cures many ills and nothing is lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    -If a hardware problem see:
    fix for Home button

  • I have just received two white I Phones 4 Model MC611LL and they bring along the Face Time feature. I own an older I Phone 4 model MC610 LL and it doesn´t have the Face Time feature. How should I get it?.

    I have just received two white I Phones 4 Model MC611LL and they have the Face Time Feature included. I own an older version of I Phone 4 Model MC610LL and it doesn´t have the Face Time feature included. How can I get it?.

    Where did you get the old one? If it came from the Middle East, FaceTime was removed from those due to government regulations. It can NOT be added back to them.

  • I keep getting a message pop up the first time I open Photoshop CC for the day, "we sorry, we can't connect to adobe server at this time...I followed instructions to turn off my antivirus and firewall, then open it. But the problem still remains. What can

    I keep getting a message pop up the first time I open Photoshop CC for the day, "we sorry, we can't connect to adobe server at this time...I followed instructions to turn off my antivirus and firewall, then open it. But the problem still remains. What can be done?

    Moving this discussion to the Creative Cloud Download & Install forum.
    R.O.B. please see Sign in, activation, or connection errors | CC, CS6, CS5.5 - http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html for information on how to resolve the connection error between the computer and our activation server.

  • What were the suggested apps to install the first time you open the AppStore?

    I just got a new ipad...never used one before so please bear with me. I just want to ask...what were the list of suggested apps to install that popped up the very first time you open the appstore? It was maybe four or five apps that was listed. One of them was iBook I think and an app to find your ipad...I don't remember the rest. Does anyone remember or knows the list? Thanks!

    1. GoodReader
    2. Dropbox

  • Application started using Java Web Start doesn't launch the first time

    I have a Facebook photo uploader application that I plan to distribute using Java Web Start. I'm using Java 6u4 on Windows XP SP2 with 2GB of RAM. I have Java 6u3, Java 6u4 and Java 5 u14 installed and I'm sure the one used is Java 6u4.
    I signed my application and make use of all security settings.
    Here is my JNLP file:
    <?xml version="1.0" encoding="utf-8"?>
    <jnlp spec="1.0+"
         codebase="http://www.antaki.ca/bloom/jars"
         href="http://www.antaki.ca/bloom/Bloom.jnlp">
    <information>
        <title>Bloom</title>
        <vendor>Carl Antaki</vendor>
        <icon kind="splash" href="http://www.antaki.ca/bloom/Bloom.jpg"/>
        <icon href="http://www.antaki.ca/bloom/bloom32.jpg"/>
      <shortcut online="false">
      <desktop/>
      <menu submenu="Bloom"/>
      </shortcut>
    </information>
        <resources>
            <j2se version="1.5+" initial-heap-size="32m" max-heap-size="128m" href="http://java.sun.com/products/autodl/j2se" />
            <property name="sun.java2d.d3d" value="false"/>
            <jar href="http://www.antaki.ca/bloom/jars/Bloom.jar"/>
            <jar href="http://www.antaki.ca/bloom/jars/BrowserLauncher2-1_3.jar"/>
            <jar href="http://www.antaki.ca/bloom/jars/SmartProgressMonitor.jar"/>
            <jar href="http://www.antaki.ca/bloom/jars/facebook.jar"/>
            <jar href="http://www.antaki.ca/bloom/jars/forms-1.1.0.jar"/>
            <jar href="http://www.antaki.ca/bloom/jars/json_simple.jar"/>
            <jar href="http://www.antaki.ca/bloom/jars/swing-worker-1.1.jar"/>
            <jar href="http://www.antaki.ca/bloom/jars/glazedlists_java15.jar"/>
            <jar href="http://www.antaki.ca/bloom/jars/swingx-0.9.1.jar"/>   
            <jar href="http://www.antaki.ca/bloom/jars/jhbasic.jar"/>
       </resources>
    <security>
         <all-permissions/>
      </security>
    <application-desc main-class="ca.antaki.www.bloom.gui.Bloom" />
    </jnlp>Here is the link for my application http://antaki.ca/bloom/Bloom.jnlp
    The first time the application is installed using a link on the browser it's downloaded then the certificate dialog is shown, after that I check the checkbox to accept the certificate permanently. The application doesn't load, it only loads the second time although I see it in the task manager. If I don't accept the certificate permanently it does load. This happens on both Firefox 2 and IE 7. I enabled the console and logging but nothing shows up there.That's really a weird problem, I wonder if Java Web Start is a viable deployment option, it does have great capabilities such as autoupdate but still seems to have important bugs.
    Does anyone have any clue about what is going on.
    The problem doesn't occur on Ubuntu 7.10.
    Thanks,
    Carl Antaki

    >
    You were right my XML file was not correct. I still couldn't find a valid JNLP validator. Sun has to provide that.>No they don't (have to supply a validator for their own document type, though it makes sense to do so), but yes they do (provide a tool that validates XML against schemas). Java can validate XML against a DTD or XSD.
    Check these two threads (and chase the links) for more details.
    JNLP xsd schema
    <http://groups.google.com.au/group/comp.lang.java.programmer/browse_thread/thread/c6f65bf1df5f105d/30c6b7e2dc342dc4>
    Validate XML against DTD? XSD OK. SSCCE.
    <http://groups.google.com.au/group/comp.lang.java.programmer/browse_thread/thread/5b997a1edb765b11/e831f3066eb4aa38>
    Look especially for the posts by Piotr Kobzda.
    I had a tool on my site based largely on Piotr's codes, that linked to a valid JNLP DTD and XSD, but unfortunately my site is offline at the moment. Andy assures me that the JNLP 6.0 DTD has been corrected for the developer ..download tutorials of web start, though the online (web site) version may still be invalid.

  • Button's Text Doesn't Display The First Time

    Hi there.
    I'm new to flash, and have come across the following problem,
    and can't seem to resolve it. It's really urgent that it's fixed
    ASAP. Can someone help me please?
    If you go to www.apollosci.co.za, the flash intro, at the
    bottom. The tab's text is missing. But when you go to another page,
    then go back to the flash intro page, the text shows. It's just the
    first time that its gone. And of course, the first time is the
    crucial part.
    I have tried different routes to fix this, by changing the
    character length, trying different codes in the menu.txt... but
    nothing seems to work. And as I mentioned above, I'm quite new to
    flash and code.
    I'm using MS Front Page to upload the website.

    I am also having this problem.  I open the app, it runs the startup screen and then the screen goes away but nothing happens.
    this is the log file that i got
    ==============
    !SESSION 2009-07-10 22:51:12.000 -----------------------------------------------
    eclipse.buildId=unknown
    java.version=1.6.0_01
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    Command-line arguments:  -os win32 -ws win32 -arch x86 -clean
    !ENTRY org.eclipse.equinox.p2.ui.sdk 2 0 2009-07-10 22:51:43.000
    !MESSAGE Could not locate the running profile instance

  • Safari doesn't load pages first time?

    Hi
    I am having a problem with Safari both on my Macbook Pro (2008) and Mac Mini (2011). The Macbook is running Snow Leopard and the Mini running Lion.
    When I boot my computers up and open Safari web pages tend not to load first time and to get them to load I have to go to another site then back to the one I was trying to get on. E.g - I click on my Facebook bookmark but it doen't load so I then have to click another bookmark such as Amazon which loads but then I click Facebook again and it loads! Its only started happening recently but I just cant work it out. My systems are fully up to date etc and my broadband connection is working fine.
    If anybody could help, would be great!

    Safari forums are a click away:
    https://discussions.apple.com/community/mac_os/safari

  • Wake up login box doesn't have focus

    When my computer wakes up from sleep it prompts me to login, but the login window does not have focus by default. If i start typing my password in it often ends up in plain text in whatever application or dialog box that is open.
    This is not nice.

    Others have noticed this too. It was thought that security update 2007-008 addressed this issue (CVE-ID: CVE-2007-4693), but apparently it was a separate problem with similar symptoms.
    It might help if you submitted a bug report to Apple so that they know they missed something:
    http://developer.apple.com/bugreporter/

  • I uses Time Machine to transfer files and program from old to new MacBook Pro. Aperture doesn't work. Every time I open Aperture the computer need me to key in Serial number. How do I fix it.

    Hi There,
    I purchased a new MacBook Pro Retina 15". Since I am using MacBook Pro and I uses Time Machine for backup files and program. Store saleman tell me I can retore my existing program and files from old MacBook Pro to new MacBook Pro computer. After files transfer it seem to be OK. But only Aperture has a problem when every time I open Aperture to edit photos, MacBook Pro ask me to key in the Aperture Serial Number that made me so inconvinent. Did any one have meet this problem and can someone teach me how to fix it, Thanks.
    Nelson

    Either the license files were not transferred or it has to be relicensed.
    Remove and then re-install aperture. On an rMBP this should take only a couple of minutes.

  • Mac mini doesn't boot the first time i turn it on

    hello,
    i have a strange problem with my mac mini and was wondering if anyone had heard of it before.
    when i turn on mac mac, the light comes on and i hear drive noise, but no chime. no video is sent to the display (the monitor flashes "no signal"). however, if i wait for 5 or 10 minutes, turn it off by holding down the power button and then turn it straight back on it again, it starts up as usual (with chime).
    could this be a software problem or is it more likely a glitch in the hardware?
    mac mini, 1.66ghz intel
    mac os x 10.4.11
    cheers,
    jack.

    That doesn't sound like a software/OS problem, because MacOS doesn't begin to load until after the initial startup, including the chime and the grey screen with Apple logo. Since you don't get the chime or display, it sounds like the system has a hardware problem, or perhaps an issue with PRAM.
    As a first step I would reset PRAM as follows:
    -Shut down the computer.
    -Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in the next step but one.
    -Turn on the computer.
    -Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    -Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    -Release the keys.

  • Safari won't open. Firefox disappeared, only question mark. Mail doesn't have content. Time Machine won't turn on because sparse bundle is in use. Please help.

    I had this issue about a month in a half ago and it was fixed by a local technician. I no longer have access to him and I really need some help. The issues are as follows:
    Safari will not open.
    Firefox disappeared. No icon, just a question mark in it's place.
    When I open mail it shows I have new messages but the content is blank.
    Time Machine cannot turn on because sparse bundle is in use.
    New files that were made are no longer available. It's almost as if the computer jumped back in time.
    The Mac Mini is running Mavericks 10.9.5

    I'll assume that you have some way of connecting to this website from the affected machine. If not, ask for other instructions.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen. Click the Clear Display icon in the toolbar. Then try to launch Safari. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Weather page stuck on initial date from the first time I opened it. Will not update. Have deleted history, cookies. Comics do not update either, still stuck on the original day I opened them after installing Firefox. Help Please

    Have updated all plug-ins and add-on. Not sure if this is related or not, when I tried to use "live chat" that link would not work.

    If you are using bookmarks to open the sites then make sure that you do not use bookmarks that have GET data appended (?xxx=xxx) to specify a specific page.
    * "Clear the Cache": Firefox > Preferences > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Firefox > Preferences > Privacy > Cookies: "Show Cookies"
    If clearing the cookies doesn't help then it is possible that the file <i>cookies.sqlite</i> that stores the cookies is corrupted.
    Rename (or delete) <b>cookies.sqlite</b (cookies.sqlite.old) and delete <b>cookies.sqlite-journal</b> and <b>cookies.txt</b>, if they exist, in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder] in case cookies.sqlite got corrupted.

  • Key Navigation when window doesn't have focus

    Using key navigation I want to allow the user to instigate a program function by with a key sequence like Ctrl-F1. This works fine as long as the window has focus but does not work if another window is active. Is there any way to get my vi to respond to the key sequence when that vi does not have the focus?

    You can use the keyboard input VIs to continuously poll for that key combination. Not as good as an event, but will work without focus. The VIs can be found in the Advanced palette before 8.0 and in the Connectivity palette (I think) later.
    Try to take over the world!

  • JFileChooser slow to load the first time...

    Is it possible to speed up the JFileChooser on it's initial load or should I just put a worker thread around it to "pretty up" the display?

    Hi
    I may have a workaround for you. Se my discussion on the topic in:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=307332
    Enjoy!

Maybe you are looking for

  • APIs for XML file creation

    hi, can anyone tell me whether there is any Java APIs for creating XML file( similar to the one used for parsing). thx in advance, -Soni.

  • Property Metadata don't change when deploying project

    Hi, 1.) I used this help http://help.sap.com/saphelp_nw2004s/helpdata/en/44/2dff5a13363f0ae10000000a114a6b/content.htm to create my own commands, uicommands, etc. 2.) I also created manually in: System Administration => System Configuration => Knowle

  • Change Employee Responsible based on user who last changed.

    CRM 5.0 Partner procedure has IC Agent & Employee Responsible. Both use partner access sequence 0008 which brings in the person that created the document. We would like to automatically change the Employee Responsible based on the last employee BP th

  • Can I use my first generation iPod on a Windows PC computer?

    I have a 10 gig very first generation iPod that I have been using on my Mac. I want to sell it to someone who has a PC. 1. Can they use it on the PC? 2. If so, what do they need to do? a) install iTunes on their PC b) get some type of fireware to USB

  • Background for JFrame

    hi I want to apply an image as a background to my application designed over the JFrame component. I want my other components like buttons and labels over that background. How is that possible? I am not using JApplet. I am new to Java & Swing so if an