Keeping track of focus gains and losses

In my application, I have a text field that a user can type in an artist/title and search a music library for the query. This application is for a touchscreen so I've included a popup keyboard for the user since no keyboard will be available to use.
The idea behind it is the user touches the text field and gives it focus. Once focus is given to the text box, ther user will then be able to touch/click a JButton that will pop up a keyboard panel. I would like to pass to the keyboard panel which text field last had focus so as they touch the on-screen keys, it will type text into the last focused text field.
I read over the tutorial for using focus listeners and I understand how that works, but how can I go about getting the object that last had focus?
I'm thinking along the lines of have a focus listener on the JButton that displays the keyboard:
// This is called when the user touches the button to display the keyboard
if (artistText.focusLost)
keyboardFocus("artist");
}Obviously the above code isn't valid, but it's how I'm trying to explain myself. keyboardFocus method will have code to setText() to the artistText text field. I can figure that one out.

I was testing something before you replied and I was wondering if it would be practical.
Here is the partial code on my GUI class:
// Calls the keyboardFocus() method whenever focus is lost on the field
// and passes the component name
    private void titleTextFocusLost (java.awt.event.FocusEvent evt)                                   
        keyboardFocus(titleText);
// Takes the passed component and stores it in a public variable
    private void keyboardFocus (JTextField comp)
        lastFocus = comp;
// Variable that stores that compoent that last had focus
    public static JTextField lastFocus;Here is a snippet from my Keyboard class:
// Then the Q button is pressed, the letter Q is set as the text to the last
// JTextField of focus
    private void qKeyActionPerformed (java.awt.event.ActionEvent evt)                                    
        GUI.lastFocus.setText ("Q");
    } If this isn't practical, I'd definate be willing to change it, but what do you think?

Similar Messages

  • Can We Change Realized gain and loss account in system option Receivables

    Hi All,
    As part of our month end processes we are posting a manual journal each month to clear this GL account down to a nil balance.
    Looking at the activity they all look to be automated AR postings on foreign currency transactions.
    Is there any way we could get these to automatically post into account 01.2201.4901 instead of 01.9000.9757? This would save us having to do the manual journal and avoid the situation of missing any which we did last month.
    Regards,
    Raju.

    Hi Raju,
    option 1
    You can change the Realized Gain and Loss Account from the System options form in Receivables, but this will be effective only for all new transactions that are going to get created and not for the existing one ...
    Option 2
    If you do not want to modify the system options, you can override the values at the accounting time frame by configuring an Accounting Derivation Rule for the Realized Gain and Loss Journal Line Type. Again this would take effect on new transactions only
    Option 3
    You can disable 01.2201.4901 and state its replacement is 01.9000.9757 in General Ledger module, so whenever system would use the replacement account for automatic processing ....
    You have to keep running the Accounting analysis report in General ledger for the account string 01.9000.9757 every month to cross check whether you have passed all Manual Journal Vouchers to make the balance NIL ... i am not sure whether there is any other way of performing a cross checking and minimizing the time that is being consumed at present ....
    Regards,
    Ivruksha

  • Foreign exchange gain and loss

    Short Text 
    Foreign Exch Gain / Loss to be booked to a diffr cost center 
    Long Text 
    The transaction booked with the following parameters
    Step 1:-Transaction booked trough FB60
    Foreign currency CHF @ 40/ruppee
    Expenses debited (1000-cost center)
    Vendor Credited
    Step 2:-Transaction paid through F-53
    Foreign currency CHF @ 50/ruppee paid
    Vendor Debited (Clearing the open item)
    Bank outgoing account Credited
    Foriegn exchange gain and loss Debited
    In ECC 6.00 Version:- The open item clearing inherits the CO objects
    from step one except for "Foreign exchange agin and loss line item"
    Note:
    1) In above scnerio, if foreign exchange gain and loss booked to some
    other cost center other than Step one:- Cost Center (Expenses booked).
    2) If the foreign exchange gain and loss line item booked to same cost
    center as specified in Step one:- Cost Center (Expenses booked).The
    below error does not occur.
    3) The requirement is to book different cost center for the Foreign
    exchange gain and loss line item.
    The following error occurs during FB05 transaction execution for
    transfering the line item in Bank outgoing account to Bank Main account.
    Error Details occur during FB05 transaction execution:-
    Start----
    Ex.rate diff.accts are incomplete for account 0002500062 currency CHF
    Message no. F5063
    Diagnosis
    The accounts for posting exchange rate differences could not be
    determined. For the specified G/L account and the specified
    currency
    key, the accounts are only specified incompletely. Either the
    accounts
    for the implemented exchange rate difference, the accounts for the
    valuation differences or the balance sheet adjustment account are
    missing.
    System Response
    The system cannot generate the exchange rate difference posting.
    Procedure
    By pressing ENTER, you achieve that the document is reset to a
    status
    without automatic posting. In another window, you can complete
    default
    settings for exchange rate differences and post the document
    afterwards.
    END----
    Configuration already in place:-
    1) Bank outgoing and main account "ONLY BALANCE IN LOCAL CURRENCY" is a
    ticked
    2) In OBA1 Foreign exchange gain and loss and valuation gain and loss
    GL's are defined for respective Reconciliation account.
    Regards,
    Sathya

    Hi,
    Is your problem solved, I am also facing the same issue when transffering from Incoming/Outgoing to Main Bank Account. Exchange gain/loss is being calculated by the system.
    Please share with me the solution to the above problem.
    Thanks & Regards,
    Jyoti

  • I am trying to create a PDF document that calculates Gains and Losses in Mutual Funds. The calculation scripts are repetitive from line to line. The scripts work well until I reach the line 32. Script stops calculating...

    I am trying to create a PDF document that calculates Gains and Losses in Mutual Funds. The calculation scripts are repetitive from line to line. The scripts work well until I reach the line 32. Although I am using the same script as the fields above in the columm, the script eventually stops calculating and I can't figure out why. Is there a limit of how many calculation scripts you can enter? I will attempt to attach my pdf as soon as I figure out how. Thanks.

    For e31 :
    var e30 = +getField("e30").value ;
    var c31 = +getField("c31").value ;
    if ( (e30 !== 0) && (c31 !== 0) ) event.value = e30 + c31 ;
    else event.value = "";
    for e32 :
    var e31 = +getField("e31").value ;
    var c32 = +getField("c32").value ;
    if ( (e31 !== 0) && (c32 !== 0) ) event.value = e31 + c32 ;
    else event.value = "";
    for e33 :
    var e32 = +getField("e32").value ;
    var c33 = +getField("c33").value ;
    if ( (e32 !== 0) && (c33 !== 0) ) event.value = e32 + c33 ;
    else event.value = "";
    Java console doesn't show any error... That's why I am wondering if it's not a limitation issue... or memory issue, because they are maybe too many rows or something....
    The c value is not calculated.

  • Issue on Gain and Loss account in F110 document

    Hello SAP Guru,
    I would like to ask your assistance regarding our accounting document. The document was produced on F110 transaction.
    Now the problem is Valuation Balance sheet adjustment, realize gain and loss are in one document.
    25 - Vendor - 727,843.35
    50 - Clearing Account - 801,874.76-
    40 - Valuation Balance sheet adj - 159,734.84
    50 - Realize gain - 85,703.43-
    40 - realize loss - 0
    How this happened? Realize loss and gain in one document, and why valuation balance sheet adjustment was used? I thought it is only use for open items?
    Thanks in advance!
    Jhero

    Hello SAP Guru,
    I have other question, I have maintained KDB accounts in OBA1. How could I test it? I mean what transactions do you have to perform to use the accounts I maintained.
    Eg.
    1. Post document FB01 - using Foreign Currency - Vendor + GL
    2. Chnage the FX rate - to have FX valuation
    3. Run FAGL_FC_VAL
    Something like above
    Thanks!
    Jhero

  • The gain and loss from asset retire ment

    hi
    The Gain and Loss from a retirement is booked to the cost center where the asset is located, is it possible to override the cost center so all will be booked to the same cost center?

    Hi
    Change the Cost Centre   or
    Go to TCode OKB9 and enter your new Cost Centre
    Srinivas

  • Gain and loss account

    Hi,
    My scenario is Mae to order, when i m going to make new Finished material , i put 1 INR in with Price control "S".Then Created sales order - creation of BOM - production order - confirmation of production order - Then Dispatch the Finished good.Then updating MR21 for price.Then in when i m going to see the accounting document there is Gain and loss account hited.Please suggest reason behind this.

    Hi,
    That's right! Because you changed the standard price of the finished good with t-code MR21, system had to re-calculate the stock value again, it led to update the stock account obviousely, so debit(credit) stock account and credit(debit) Gain & Loss account to balance the financial balance sheet.
    Good day
    Tao

  • Keeping track of portal content and transports

    Hi,
    We have a DEV portal Ep 6.0 sp19. We would now like to setup QA and PRD systems and need a way to manage content between portals.
    The document 'Best Practice - Transporting NetWeaver Portal Content'  suggests using a Word document to keep track of content changes and transports.
    link:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/519d369b-0401-0010-0186-ff7a2b5d2bc0
    Is there a SAP template that can be used as a starting point for such a document?
    Regards
    Sunil

    Hi schlueterd!
    Build a small applet extending Runnable, ie: a threaded one. Each time its "run" method loops the applet will read an small input file and updates "displaying score" component.
    Of course you'll need to update this input file as soon as possible.
    You'll use few classes and a good reference is any applet displaying scrolling text (search for open source in the web).
    I hope it helps.

  • Currency gain and losses

    Hello,
    Is there a report where I can get the currency gain and losses from the exchange rate in a specific period?
    Regards,
    Barbara

    Hi
      You should run the foreign currency valuation program in order to obtain the profits or lost ..
    Check this out
    http://help.sap.com/saphelp_erp2004/helpdata/EN/a6/004940f0030272e10000000a155106/frameset.htm

  • Keeping track of baseball runners and score.

    I am new to java and am trying to come up with a way to keep track of base runners and scores for a baseball game. again I am new so the simplest way is preferred. Any help would be appreciated, thanks alot.
    dean.

    Hi schlueterd!
    Build a small applet extending Runnable, ie: a threaded one. Each time its "run" method loops the applet will read an small input file and updates "displaying score" component.
    Of course you'll need to update this input file as soon as possible.
    You'll use few classes and a good reference is any applet displaying scrolling text (search for open source in the web).
    I hope it helps.

  • Keeping track of focused sub...subcomponents

    How can a container keep track of whether any of its descendent components gets focus?
    For example, we do
             container1.add(container2);
             container2.add(component);and somewhere else call
            component.requestFocus();How can container1 find out when component gets focus?
    In 1.4.0 one can listen on the KeyboardFocusManager for changes in focus, but I need a solution that also works in 1.1.8.
    Thanks,
    dog

    Isn't there an event type for gaining focus?
    Yeah, here it is: java.awt.event.FocusListener.
    Perhaps the ancestor component can create a FocusListener and add it to its descendant components' FocusListener lists.

  • Any table keep track of Sales order and relevant IDOC

    hi all,
    Do we have any table to keep track Sales order and its relevant IDOC in the system?
    A list of sales order# given by user, from the list, we would like to find a faster way to get the corresponding IDOC.
    thanks.

    Hi Reetha,
    EDIDS table would have the IDOC Number & sales order number. Parameter 2 is the field in EDIDS which would have the sales order number.
    I understand that this table would have many records but i dont think any other table would have the above combination. If you get any other table, then pls. do update @ it on this thread.
    Thanks,
    Best regards,
    Prashant

  • Trading Partner in Gain and Loss from valuation

    Dear Friends,
    My issue is with the valuation posted for account maintained on line item basis only (Not open item managment).  Since the account is maintained on line item basis, only balance is valuated each month thru f.05.
    The problem is that when account posted with Loss or Gain each month on valuation, the document will not have a Trading partner assigned which causes my inter-company elimination issue.
    How to get Trading partner assigned to document posted on valuation (F.05) I have tried sustitution rule and OB32 to make Trading Partner as editable but SAP does not allow both.
    Best Regards
    VK

    Thanks Venkata,
    My problem is with the autmated posting result from forex gain or loss when carrying F.05. These documents autmatically created but donot update the Trading Partner. I can not manually input them even if enter Trading Partner is option in OBA7 is checked.
    Best Regards
    VK

  • Doubt in physical inventory regarding gain and loss

    Hi Experts,
       Kindly let me know, what we will be doing while we face gain of some materials during physical inventory and loss of some materials during physical inventory?
    Regards,
    Prasath

    hi priyanka,
        i am getting an error while i am trying out this. i am counting stocks in quality inspection also. there i am getting more stocks, so, i have tried to post the (gain)difference using 701 but it is showing an error
    " Reason 0701 for movement type 703 not defined "
    and then i tried with movement type 703 to post the difference, again it is showing another error like
    " Entry 0703 does not exist in T157D (check entry) "
    Is there any movement type especially to post gain/loss in quality stock in physical inventory ??
    how could i resolve and post this gain in quality stock. kindly help me.
    Regards,
    Prasath

  • BPC : Keeping track of previous entries and nullify them

    Hi,
      i have a situation, assuming i have entered a value of 10 for account(sales1), entity(asia), category(budget). then i realized i have made a mistake, and that the value 10 is for account(sales2), entity(asia), category(budget).
      By doing things the normal way, there are 2 data created in the database. But is there a feature within BPC that allows me to keep track of the first entry that i have done, so that i can nullify (or zerorize) the entry?
      This is assuming account(sales1) and account(sales2) fall under different parents, and that my input schedule is a single row input schedule (i.e. not your typical large input schedules where you can cover a lot of different dimension members)
      thanks in advance for any feedback possible.
    cheers

    The best tool in BPC to review the inputs is the Audit functionality.  If you have this enabled and have the appropriate security, you would be able run a report to see the input value and string, who entered the data. From this information you would be able to resend a nulling amount to the DB and resend the original amount.
    The only other options, which are requested frequently are for validations.  The NW version allows you to build the validations into the back-up to test for conditions prior to sending.  In the MS version, the validations are accounts in the application account dimension, or it could be (this is not easy) an additional application that allows for only valid combinations, defined by someone, to be available in input and report frameworks using evdre and suppression. Hopefully to limit your chances of selecting a bad account.
    But unless the Audit functionality is invoked for each category, and Office functions, I am afraid you will not have any tracking mechinism.
    Hope this helps.

Maybe you are looking for

  • I need to find a Windows Server that suits my needs (one that I can physically own, not rent from an online service

    I am currently running my servers on my gaming PC (Intel i7 3rd gen core processor, 8gb RAM, 1tb hard drive), but I can't game with all the servers up. But what I can do is keep the server I'm playing on up. I often have to shut them down every weeke

  • Java.lang.LinkageError in weblogic 10.3

    i had deployed the jasperserver.war in weblogic 10.3 server... i am getting the following exception... Context Initialization failed org.springframework.beans.factory.BeanDefinationStroreException:unexpected exception parsing xml document from Servle

  • HT1977 Old App purchases are not appearing in itunes 11

    I have recently upgraded from iTunes 10.x to iTunes 11 and my old purchased Apps that were not on my ipad but on my computer are not appearing in itunes 11 to put back on my ipad?

  • How to disable Toptip.ca

    In the (now closed) thread: https://support.mozilla.org/en-US/questions/814310#answer-174482 It recommends: "Go into the options and untick the double click to translate box" for "Google Dictionary and Translate 2.5 add-on" ... but does not explain h

  • Workspace 10 has no privileges to parse as schema APEX_030200.

    I'm installing apex 3.2 into a 10.2.0.3 database and the install went fine. I've followed the same procedures to install apex in several other database with the same characteristics and they are all running fine. But in this install I get the "Worksp