Regain focus on FormattedTextField when message displayed...

Hello,
I have a formatted text field that takes a mask formatter in the form of "####"
People should fill in a number between 0-9999.
However, when the focus is put on the next field (a radio button ic), I want to display a messagedialog saying "Please fill in the number" when nothing is filled in.
So far, so good.
NOW I would like the formatted textfield to automatically regain the focus after the user has pressed "OK" in the message dialog...
I have tried putting a requestFocus() right after the messagedialog-code, but then it repeats the message dialog 3 times (requiring to click ok three times) and only then it puts the focus on the text field again...
Any ideas to make sure the focus is regained after one click?
(So basically I want to oblige the person to fill in the first field...(and some others!))
Thank you

This is the code:
(don't pay attention to the messy coding rules...I suck at those...) (plus just beginning to program here...)
public void jdesiredCalFormattedTextField_focusLost(java.awt.event.
FocusEvent e)
String cal=new String(jdesiredCalFormattedTextField.getText());
cal=cal.trim();
jdesiredCalFormattedTextField.setValue(cal);
if (jdesiredCalFormattedTextField.getText().trim().length()==0)
JOptionPane.showMessageDialog(
null,
"Gelieve gewenst aantal calorieen in te vullen.",
"Calorieen foutief!",
JOptionPane.ERROR_MESSAGE);
jdesiredCalFormattedTextField.requestFocus();
else
jSchemeResultDesiredCalLabel.setText(cal);
jDesiredResultsOverviewResCalLabel.setText(cal);
so it checks whether the field is empty (trimmed length==0), if so, it gives the messagedialog, and after the messagedialog it requests focus again...
Using Java 1.4.2_04
thnx
Wouter

Similar Messages

  • HT201210 When I try to update my iphone to the latest iphone software on my MacBook in itunes a message displays "This iphone cannot be updated at this time because the iphone software update server could not be contacted or is temporarily unavailable.

    Hi guys, When I try to update my iphone4s to the latest software on itunes via my MacBook a message displays a message: 'This iPhone "Seans iphone" cannot be updated at this time because the iphone software update server could not be contacted or is temporarily unavailable'. This has happened a few time s now. I have look through the FAQ's but no luck. Can someon help? Cheers

    Try posting to the correct forum.
    This is the iPhone for the Enterprise forum... there is nothing about the issue that appears to apply to using an iPhone in an Enterprise (corporate) environment.
    Try posting to the iTunes for the Mac forum.

  • When I close the CHM how do I get the application it was launched from to regain focus?

    I am developing a CHM for an application that runs on
    Windows. When I launch the Help (CHM) from the application, then
    close the Help, I want the application that I launched the Help
    from to regain focus. (I would expect this is what most people
    would want to happen, and this is what happens with Microsoft
    generated Help files.) However with my RoboHelp CHMs this does not
    happen.
    Does anyone know how I can fix this behaviour? Is there a
    setting in RoboHelp that I need to change?
    My R&D application developer has spoken with Microsoft
    and they suggested the problem was with my RoboHelp CHM, they
    suggested trying the following process with one of their CHMs and
    then with one that I created using RoboHelp, and they are correct
    in that my RoboHelp CHM is behaving differently. Here's the
    procedure if you'd like to try it:
    - Open a Windows Explorer window.
    - Navigate to the c:\WINDOWS\Help folder (or equivalent on
    your PC).
    - Double-click on the iexplore.chm file. Note that the help
    file opens up in a viewer window.
    - Dismiss the viewer by clicking on the close button (X).
    - Note that focus is returned to the Windows Explorer window.
    Repeat the above experiment, but navigate to where you have a
    RoboHelp CHM file. I find that when I dismiss the help viewer
    window, focus is NOT returned to the Windows Explorer window. Do
    you see the same thing with your RoboHelp CHMs? If not, what have
    you set to cause the application that it was launched from to
    regain focus?
    I really appreciate any help you can give me in resolving
    this issue.
    Best Regards, Sharon

    Hi Sharon
    Hmmm, where exactly *IS* the focus in your tests after
    closing the RoboHelp generated .CHM file? I just tested and saw the
    same behavior regardless of whether it was a Microsoft .CHM or a
    RoboHelp HTML created .CHM. Each time, the focus was returned to
    Windows Explorer.
    I do know that the manner in which your developers open a
    .CHM can vary. For example, your developer can specify that a
    particular tab have focus, such as the Index or TOC, while simply
    double-clicking will result in the last opened tab being the active
    tab.
    Wish I had more to offer here, but I'm not seeing the same
    behavior as you are. I do know there are some extended settings for
    your window, but I'm doubtful that's the answer here.
    Also, I'm not too sure how much stock I'd put in something a
    Microsoft call center stated. Just the nature of call centers. Some
    folks that staff them are good and skilled, some are a bit, shall
    we say, lacking. This is truly "Luck of the draw".
    Sincerely... Rick

  • Problem when a JPanel with a JDialog regains focus

    I've a simple application with a JFrame and a nested JDialog under MS Windows. When it regains focus (i.e. another application like MSWord was active and with Alt+Tab or with a mouse-click in taskbar I force my application to gain focus), the JDialog becomes active but I can't see the JPanel because between the dialog and the panel there is MSWord. In z-order I've get the dialog at top, under it MSWord and the panel at background. That's not the regular behavior, but sometimes it happens. Any idea to avoid always this behavior?
    Thanks in advance.

    Any solutions to this problem???

  • "Internal error: An unexpected exception has occurred" error message displayed when browsing a cube.

    “Internal error: An unexpected exception has occurred“ error message displayed when browsing a cube.
    The error behaviour is quite irregular and does not occur for specific condition.
    Will cumulative update 9 for SQL Server 2008 R2 (SP1) installation help to fix the issue which is provided on the below link:
    (http://support.microsoft.com/kb/2152148)
    The current version of SQL Server I am using is as below:
    Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)   Jun 17 2011 00:54:03   Copyright (c) Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
    Thanks in advance for the help!

    Hi Mon,
    The hotfix you said is for Microsoft SQL Server 2008. So it will not work on your scenario since you are using SQL Server 2008 R2.
    Based on the limited information, we cannot give you the exact reason that cause this issue. In order to narrow down this issue, you can apply the latest Service Pack and Cumulative Update as GregGalloway said. Besides, you can troubleshoot this issue by
    using the Windows Event logs and msmdsrv.log.
    You can access Windows Event logs via "Administrative Tools" --> "Event Viewer".  SSAS error messages will appear in the application log.
    The msmdsrv.log file for the SSAS instance that can be found in \log folder of the instance. (C:\Program Files\Microsoft SQL Server\MSAS10.MSSQLSERVER\OLAP\Log)
    Here is a blog about data collection for troubleshooting Analysis Services issues, please see:
    Data collection for troubleshooting Analysis Services issues
    Regards,
    Charlie Liao
    TechNet Community Support

  • I'm using LR5.7 on a Mac Mini running Mavericks and when I attempt to import a folder of new RAW photos from my external drive into my catalog instead of seeing a preview of each thumbnail photo I see the following message displayed: "Preview Unavailable

    I'm using LR5.7 on a Mac Mini running Mavericks and when I attempt to import a folder of new RAW photos from my external drive into my catalog instead of seeing a preview of each thumbnail photo I see the following message displayed: "Preview Unavailable for this file." If I highlight any other folder of photos the previews are all there. What is the likely reason for these previews being unavailable? JohnnyCam

    What camera took these RAW photos?
    Did you use any Nikon software to transfer the photos to your computer's hard disk?

  • HT5361 MacMail has stopped noting when I have read an email.  For example, I had 17 unread messages, so I read them.  Despite me having read them AND deleted them, the inbox still has 17 new messages displayed.  Can anyone help resolve the incorrect displ

    MacMail has stopped noting when I have read an email.  For example, I had 17 unread messages, so I read them.  Despite me having read them AND deleted them, the inbox still has 17 new messages displayed.  Can anyone help resolve the incorrect display?

    Lord K.  Thank you. Yes I am within the 90 time period, however I travel Intertionally and I can not receive not make a call to Apple. I was just at the Genius Bar in Chicago and they said, don't worry about it.  It just floats out there, however, I can not recover my messages on a flash drive. I need to go back to my old computer which I don't have with me.  My messages were in folders for a lawsuit.  It is going to take an incredible amount of work for me to, you have no Idea.  We are talking thousands of pages!  I the defendent will have them during discovery so I am not so worried.  However, I can not bring them to him on a Flashdrive when I meet with him without an extraordinary amount of presssure on my part.  THis is not just some little email issue. This is suing EXPEDIA and Tripadviosr.com

  • In my app store account appears money, but when I try to buy a game with my iPhone, a message display saying that I don't have enough credit, why?

    In my app store account appears money, but when I try to buy a game with my iPhone, a message display saying that I don't have enough credit, why?

    If you're in the US, are you including the sales taxes charged in your location when you calculate how much you'll need?

  • Message displays itunes cannot read the contents of the iphone when connected on a laptop. Doesnt let me back up and sync and asks for restoring to factory defaults??!!

    message displays itunes cannot read the contents of the iphone when connected on a laptop. Doesnt let me back up and sync and asks for restoring to factory defaults??!!

    Hello ardninam,
    Thanks for using Apple Support Communities.
    If the content on your iPhone cannot be read by iTunes, then you will need to follow the directions in the popup and restore your iPhone to the factory settings.  You can then try and restore from a previous backup.
    Use iTunes to restore your iPhone, iPad, or iPod to factory settings - Apple Support
    Restore your device from an iCloud or iTunes backup - Apple Support
    Take care,
    Alex H.

  • Text Message display on Curve 9360

    Hi...just got a new Curve 9360. The default text message display shows all messages i.e. if I've sent a text most recently that is what I see at the top. What I want it to do is show the SMS Inbox (which I can navigate to via the folder options, but I can't find a way to set it as a default). Can't work out how to do it either on the device or when connected to the PC. Any suggestions...?...R

    Do you mean that currently ALL of your email messages and SMS text messages are mixed in one folder when you view, and you want to see a folder on your homescreen of ONLY your SMS text messages? And your email messages in another folder?
    If so, on your device, open that Messages folder > press the Menu key > Options > Inbox Management and check the box on "Text Messages", and save. That will put an SMS Text message folder on your screen.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • In Mail 3.6 remote images in HTML messages display as blue squares with ? even though checked in viewing references.

    In Mail 3.6 remote images in HTML messages display as blue squares with ? even though checked in viewing references.

    Nurit,
    The point is that that button should not be there, if the preference setting is as you say. This indicates the preference setting is stuck, and that is what I was trying to help you resolve.
    The full purge is done as follows:
    Quit Mail, and in the Finder open Home/Library and locate the Mail folder. Control-click over the Mail folder, and choose Duplicate -- then drag the resulting copy to the Desktop for temporary backup. Next, open Home/Library/Preferences and find the com.apple.mail.plist file and drag it to the desktop.
    Relaunch Mail, which will open as though new, and when prompted to import anything DECLINE. Instead, re-enter your account info, and Mail will re-discover the account folders for your accounts, and all should be well, after setting preferences as you desire.
    Ask any needed questions, and keep us posted.
    Ernie

  • Error message display for PO creation with reference to internal orders

    Sir,
    While creating PO with Tcode ME21N (item category I) with reference to ' Internal Order with Funds provided (Tcode KO12), system displaying error message  when Budget is exceeded.
    But when Funds provision is not mentioned (Funds value is initial in KO12) , error message is not being given by the system during Po creation with ME21N.
    Where should I configure in img(Tcode SPRO) , so that system will throw error mesage while creating PO without Budget Provision (Funds not mentioned ) in Internal Orders.
    Regards,
    Srinivasa Murthy

    Hi Anupam,
    The error message display as follows. (when the PO Price exceeds the Planned Funds kept for internal order)
    This error comes during PO creation Process and PO can not be saved. This error message display is correct.
    Item 001 Order 600643 budget exceeded
    Message no. BP604
    Diagnosis
    In document item 001 Order 600643, budget  for fiscal year 2009 was exceeded by 99,960,000.00 INR.
    But  my question is 'when funds have not at all been mentioned for the internal order' then system has to throw the same error as mentioned above. But it is not happening. System is allowing the PO to save which is not correct.
    Regards,
    Srinivasa Murthy

  • While raising Leave Request on ESS: getting warning message displayed

    Hi All,
    When i am trying to raise a leave request from ESS i am getting the warning message displayed on the page  as follows:
    "Customizing for employee 00001153 does not exist"
    I want this message to be removed.
    Is this problem from R/3 end or any configuration needs to be done on ESS ?
    Pls let me know how to remove this message.
    Regards
    Vijay

    this message ensues when there is a missing customisation for the pernr, For example :
    message is being displayed due to rule group customizing is missing
    for a leave '0560' for which a leave record exists on the date
    '14th March 2008'.
      One possible solution would be to create a record in the customizing or delete the record from the application.
    So please check the customisation of the absences, Quotas, rule group etc for this particular employee

  • Document in BSEG but not in BKPF. Message displays Document not in Database

    Good day!
    We are using SAP 4.6C.
    Our client wants to display a document posted some time ago using FB03.
    The message displayed, "Document not in database. Search Document archive?"
    I looked for the document in BSEG and found that the document exists there.
    However, the document header data are missing in BKPF.
    Is there a transaction code that could have archived/removed the data in BKPF while
    not changing anything in BSEG?
    Could there be a way to retrieve these data?
    Thank you!

    Good Day !
    For your information, the pop up message prompting for archived mesages "Document is not in database. Search document archive? " is not present anymore in the release ECC 6.0. This pop existed in your release  and this has been phased out as part of continuous product improvement after inputs from various customers.
    In the newer releases instead of this pop up we have the message
    "Document XXXX XXXXXXXXX XXXX is already archived" being displayed at the lower bottom of the screen. This helps you identify that the document was archived. This is the standard SAP behaviour.
    Therefore, your document is archived. To able to retrieve this document again you can use Tcode FBL3N and change the Data source option (there is a button for that) to Archived Data.
    The same you achieve in FB03 when you select Document List button and then Data Sources Button, mark the option Archive.
    I hope this helps.
    Best Regards,
    Vanessa.

  • SQLException in the audit log for the Message Display Tool

    Hi
    I´m newbie in PI Technology, and i have some issues when i try to do the next.
    This is the scenario:
    I need to communicate two systems, for one side i have SAP, and for the other side i have ADI (legal system) so, i use PI to do this (the communication), PI receive the data from SAP by means abap proxy, until this everything is correct, then i do the mapping of the data and i send a message to ADI (with the SAP XI Runtime Workbench) by means JDBC adapter, if i check the sended message with "Message Display Tool" show that the message was sent (status "Delivered") but if i check the received messages option, in the audit log displays the five next errors:
    Error: Could not execute statement for table/stored proc. "FADIA4" (structure "StatementFADIA4") due to java.sql.SQLException: FADIA4 in FILEMET not valid for operation.
    Error: JDBC Message processing failed, due to Error processing request in sax parser: Error when executing statement for table/stored proc. 'FADIA4' (structure 'StatementFADIA4'): java.sql.SQLException: FADIA4 in FILEMET not valid for operation.
    Error: MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'FADIA4' (structure 'StatementFADIA4'): java.sql.SQLException: FADIA4 in FILEMET not valid for operation.
    Error: Adapter Framework caught exception: null
    Error: Delivering the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'FADIA4' (structure 'StatementFADIA4'): java.sql.SQLException: FADIA4 in FILEMET not valid for operation..
    if there are somebody that maybe could know what is the problem?, could the problem be the side of the legal system?, because inside of PI when i do the Test Configuration in the Integration Directory, the end of the test is successful.
    Any comment is well received!!
    Thanks,
    Vicman
    P.D. sometimes the error is: java.sql.SQLException: Token ) was not valid. Valid tokens: DAY PATH YEAR LABEL MONTH OPTION RESULT CONNECTION TRANSACTION.
    what does it means?

    Hi Pooja,
    thanks for you quickly response!
    XML sended:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_PgDocVentaECC_req xmlns:ns0="http://gmodelo.com/ECC/enviarCobranza">
       <DT_DatosDeControl>
          <MIDDLEWARE_ID/>
          <QUICK_ID/>
          <INTERFACE_NAME/>
          <MESSAGE_ID/>
          <LOG_ID/>
          <USER_ID/>
          <SOURCE_SYSTEM/>
          <TARGET_SYSTEM/>
       </DT_DatosDeControl>
       <DT_PagoDocVentaECC>
          <VKORG>TVKO</VKORG>
          <VKBUR>TVBUR</VKBUR>
          <VKBUR1>TVBUR</VKBUR1>
          <ROUTE>TVRO</ROUTE>
          <ROUTE1>TVRO</ROUTE1>
          <BLART>Q</BLART>
          <BELNR>100</BELNR>
          <WRBTR>200</WRBTR>
          <LFART>100</LFART>
          <VBELN>100</VBELN>
       </DT_PagoDocVentaECC>
    </ns0:MT_PgDocVentaECC_req>
    this is the XML received:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:MT_PgDocVentaADI_req xmlns:ns1="http://gmodelo.com/ADI/recibirCobranza">
    <StatementFADIA7>
    <FADIA7action="INSERT">
    <Table>FADIA7</Table>
    <Access>
    <NUMCIA>123</NUMCIA>
    <NUMALM>234</NUMALM>
    <SUBALM>300</SUBALM>
    <CVETOP>16</CVETOP>
    <FOLOPV>22</FOLOPV>
    <SECOVA></SECOVA>
    <IMPOVA>200</IMPOVA>
    <ALMOVA>5678</ALMOVA>
    <SUBOVA>21</SUBOVA>
    <TOPOVA>21</TOPOVA>
    <FOPOVA>41</FOPOVA>
    <FECOVA>100</FECOVA>
    <STSOVA> </STSOVA>
    </Access>
    </FADIA7></StatementFADIA7>
    </ns1:MT_PgDocVentaADI_req>
    what do you think about it?, anything wrong?

Maybe you are looking for

  • New MBP -- Wireless Connectivity Inconsistent (Despite MBP's Claims)

    Have a new MBP, running 10.5.6 straight out of the box. All essential system updates have been downloaded and installed (one FCE update remains undownloaded). The Airport connection is tenuous -- it will stay connected to the internet for hours at a

  • I lost my bookmarks from my previous Firefox version with the Yosemite upgrade

    When I upgraded to Yosemite on my Mac, I lost all my previous Firefox bookmarks. I have tried to look through the help sections and can't fix this problem. All my bookmark toolbar tabs were incorrect as well, but I was able to replace them. I may hav

  • Can I run 34 bit Captivate on a 64 bit OS

    I am experiencing RAM issues and want to upgrade to a 64 bit OS so I can upgrade my RAM above 4GB. I want to know if a 64 bit Captivate will run on a 64 bit OS.  If not, will there be any compatibiliy issues if I do upgrade to a 64 bit Captivate and

  • Database mapping to XML

    Hi all... I have 6 tables in an Oracle DB that I want to export to XML. 4 of these tables have relationships (primary key - foreign key). As a result, I want to have all related objects mapped as child elements of their respective parent. So the resu

  • How to know last statements

    Hi All, How can i know, what are the statements have run on yesterday in my database for a particular user? Thanks Desis