Replace the component name to universal?

Hi!
I have put some code into the "FocusLost" event of the jTextField. Here is it:
private void jTFprobaFocusLost(java.awt.event.FocusEvent evt) { 
if(jTFproba.getText().equals("wrong"))
jTFproba.setBackground(Color.red);
else
jTFproba.setBackground(Color.white);
jTFproba.setText("OK");
It works, but I have about 20 similar TextBox in my application and I am interested in whether it is possible to replace the name of the component (jTFproba) to something universal like "this"?
For example:
private void jTFprobaFocusLost(java.awt.event.FocusEvent evt) { 
if(this.getText().equals("wrong"))
this.setBackground(Color.red);
else
this.setBackground(Color.white);
this.setText("OK");
But it does't work!
Do you have any ideas to replace the component name?

See the documentation of FocusEvent. It has a getComponent() method that I assume returns the component that has lost the focus (in your case, a JTextField instance). You can add the same listener to all JTextField instances, and cast the source to JTextField.
It also has a getOppositeComponent() method that presumably returns the component that has gained the focus, if that matters.
I assume for a focusGained() callback it's the contrary.
Edited by: jduprez on Nov 4, 2010 2:55 PM
Mixed method names, so reverted to a conservative "I assume" description

Similar Messages

  • How to get the component name in webdynpro

    Hi all,
            how can i get the name of the webdynpro component. The component is being displayed in the portal. Now i need the component name for this.Can any one suggest of how to get this.
    Regards,
    Kalyan Chakravarthi.M

    Hi ,
    get the object of  IF_WD_COMPONENT , by calling the method wd_get_api( ) of wd_component attribute , then call the method GET_COMPONENT_INFO( ) ,it will return the object of IF_WD_RR_COMPONENT in that call the method GET_NAME( ) .
    Regards
    Yash

  • Replace the component after batch determination in the process order.

    Hi dudes,
    How we can replace component for which batch determination done with a new component in a process order. can any body suggest if its possible.
    thanks in advance.
    Robert

    Hi,
    i am not able to delete the component in the materials overview after the batch allocation done by batch determination rather giving batch manually.
    i.e if i give batch directly in the batch field i can able to delete that entire component row, but if do batch determination for that component once its done i can't  able to delete.
    thanks in advance
    Robert.

  • Conflict with the component names

    Hi everybody,
    I think I have a conflict with the names of the components. Let me explain to you.
    On the first window, I have a component described like this :
    Component Type -> Text Input Component
    Component Name -> ArgoLineClientV2R4_Text_1_txf
    On another window, I have this :
    Component Type -> Graphics Component
    Component Name -> ArgoLineClientV2R4_Text_1_txf
    As you see, these components have the same name but are different type. With the first, I manage to write the word in. With the second, I want to extract a word but I can't.
    So, I would like to know the reason. Is it because the components have the same name? Is it because the second component is a Graphics component ?
    Thanks for your time.
    Best regards.
    Romain.

    Hi Oliver, thanks for your answer.
    ArgoLineClientV2R4_Text_1_txf is the technical name, given by Jubula during the object mapping. In my program, I use different names of course.
    These two components have different functionalities. With one, I write a word in; and with the other the software gives me an information (a word). With the second, i can only read the information and I need to take this information to put it in a String variable. So I tried to extract this information but I (my program) failed. I wanted to make a clic and make a copy of the word. But when I try to clic, my test fails.
    I think it is because Jubula describes this component like a Graphics Component whereas in the software parameters, this component is a text field (in mode ReadOnly but a text field).
    Here is my situation.
    Regards.
    Romain

  • How to find and replace the table name/column name

    We have just upgraded the application to R12. Have many reports developed in Oracle Reports Builder. There are many changes in R12 table and column names when compare with 11i. Please suggest a solution to change the table name or column name in multiple reports queries instead of doing manually.

    A Google search may turn up a downloadable service manual for the Laserjet 4600.
    You might also ask in the HP Enterprise Business Community Forum here.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • Will apple replace the component or the whole of iPod touch?

    i accidentaly dropped my iPod in my bathroom , and now the screen digitizer is cracked , the LCD is okay . Can apple replace only the cracked screen or i need to buy the new one?

    Apple will exchange your iPod for a refurbished for this price:
    Apple - Support - iPod - Repair pricing
    A third-party place like the following may be less expensive. Google for more places.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens

  • How to find out the Target Component name and Target view name

    Hi All Expert,
                      I want to know ,how to find out the target component and target view in WEB UI,when i click on a field which shows as a hyper link in WEB UI .At GUI level ,i know the how it will work.Any way to find out the component name and view name which is show the details of that field at GUI level .IF you go to transaction CRMD_ORDER then open the service contract id .then goto the item level value .there is 1 service data tab is available at item level.there is two button is available.first one is available time and second one is response time .if i click on any button then one popup is open which is shows the details of that button.I dont know how to find out the component name and view name from GUI level.
    Thanks in Advance....
    Vishwas Sahu

    Hi Vishwa,
                 The control would be something like this for navigation in Get_p_xxx method u mention as link and u mention a event name which gets triggered on the click of this hyperlink. So your GET_P_XXX method would have the following code:
    CASE iv_property.
        WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
          rv_value = cl_bsp_dlc_view_descriptor=>field_type_event_link.
        WHEN if_bsp_wd_model_setter_getter=>fp_onclick.
          rv_value = 'EXAMPLE'.
    Now you have to create a method as EH_ONEXAMPLE at your IMPL class and within which you would give an outbound plug method. Within the outbound plug the target data would be filled in the collection and window outbound plug would be triggered.
    This is a huge topic and  i have just mentioned you basic things.
    Regards,
    Bharathy.

  • How to find the ABAP Webdynpro Component Name in the Portal IView(WDA)

    Hi All
    I got one ABAP Webdynpro IView in portal , when i opened the Iview i got the Application name of ABAP Webdynpro in the properties of the Iview but i could not able to find the component name .
    Please let me know how to find the component name of WDA , as i already got the Application name of component  from Iview i.e WDA_ED_RDF ( this is applicaiton name found in the portal Iview for ABAP Webdynpro)
    Please get back to me on the same , it would be great help to me.
    Thanks,
    PortalUser100
    Edited by: PortalUser100 on Mar 24, 2011 11:51 PM

    Hi
    Right Click on any UI Element in Portal->Go to more field help->TEchical Information. You can see all the information about component, application, ui elements etc.
    Please check this... may helps more
    http://wiki.sdn.sap.com/wiki/display/WDABAP/GeneralTechnicalAspects
    Thanks,
    Venkat.

  • BP Fact sheet: how to translate component name?

    Hello
    At my customer BP fact sheet is custimized to include a custom component. The component name is Z-custom and the description in english is "custom". If I log on to the web UI in english I can see the title on the windo "custom". But if I log on in other languages it is empty.
    This is because there was no translation to the component name before. I added the translations in SPRO - Maintain Fact Sheet but still nothing is shown in the web UI. I also checked BSP_WD_CMPWB but found no place for translation.
    Can anyone help? It must be something really quick ans stupid !!
    Sotiris
    Edited by: Sotiris Hatzis on Jul 6, 2011 12:26 PM

    Actually I also made some other changes in transaction BSP_WD_CMPWB (like titles of columns) but these changes are not shown either onthe Web UI.
    Do I need to activate something, or run something?
    Sotiris

  • Ampersands in component names (very minor issue)

    This issue is not creating any problems for me, just something I have observed.  When an ampersand (&) symbol is inserted into a component name, the ampersand is not actually displayed anywhere once the change is made, but what appears to be an underscore (_) appears instead.  A space also appears at the beginning of the component name within the Object Browser.  Obviously a very minor issue but thought I should report it.

    Well, for what it's worth, this is what I get at this moment when I attempt to view this thread while logged in under Firefox 3.03:
    An error in the system has occurred. Please contact the system administrator if the problem persists.
    type: java.lang.NullPointerException
    java.lang.NullPointerException
         at jsp_thread_2d_flat1226300463732._jspService(jsp_thread_2d_flat1226300463732.java:556)
         at com.sap.engine.services.servlets_jsp.server.jsp.JspBase.service(JspBase.java:112)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:544)
    code}
    It's actually a very long block of code.  When I refresh, sometimes no posts are displayed at all here.

  • Pass Component Name to Generic "Condition" w/o hardcoding it

    Hi, thanks in advance for your help.
    I'd like to create a generic PL/SQL "Condition" statement which references the Component Name of the component executing the Condition - without hardcoding the component name in the query. In other words, a statement which I could plug in to any component's Condition clause without hardcoding the name for each component. Is there a Substitution String, application variable or some other mechanism I can grab which has this value?
    What say ye Oracle... Can I get there from here?

    I'm not sure it does require an enhancement request, since I'm pretty sure you could code that using authorizations right now.
    For example, assuming that you have different levels of users (e.g. level 1, level 2, level 3 etc), where -
    Level 3 is the lowest level
    Level 2 can do everything level 3 can do, plus a bit more
    Level 1 can do everything level 2 can do, plus a bit more
    Then you could define a table mapping users to levels (e.g. "Joe" is level 2).
    Then in your Application you create authorization levels for Level 1, Level 2, Level 3 etc (i.e. you're specifying that a user must be at least Level 2 to see this item etc).
    You create a new item and assign it an authorization level of 'Level 2', therefore only users who are Level 2 and above will be able to see the item.
    Obviously I've missed out a huge chunk of the implementation here ;)

  • Getting component name

    Guys,
    I want to find the component names of my dynamic table
    ASSIGN COMPONENT  sy-index
             OF STRUCTURE <wa_table> TO <dyn_field>.
    I know there are couple of threads but they are confusing, I tried using one of the method
    ref_table_des ?=
    cl_abap_typedescr=>describe_by_name( p_data = <t_dyn_table> ).
    idetails[] = ref_table_des->components[].
    but then I get an error as formal parameter p_data  does not exist.

    Check this Example.
    DATA : sflighttype type ref to cl_abap_structdescr,
          comp_tab    type cl_abap_structdescr=>component_table.
    field-symbols: <wa_comp> like line of comp_tab.
    sflighttype ?= cl_abap_typedescr=>describe_by_name('SFLIGHT').
    comp_tab = sflighttype->get_components( ).
    LOOP AT comp_tab ASSIGNING <wa_comp>.
      write : / <wa_comp>-name.
    ENDLOOP.
    In your case.
    it should be
    ref_table_des ?=
    cl_abap_typedescr=>describe_by_name( <t_dyn_table> ).

  • How to replace a component in the JPanel?

    Hi,
    I want to replace a component in the JPanel. My panel has GridBagLayout.
    Thanks in advance.

    because my application demands me to use GridBagLayout.No it doesn't, that a choice you made. You are never forced to use a specific layout manager. In fact most layout problems are solved by using combinations of layout managers. You two main choices are:
    a) use a GridbagLayout for the main panel and then a CardLayout for the two components you want to sway, although it may look strange if the components are a different size as the preferred size of the panel will be the size of the largest component
    b) Simulate a card layout using:
    panel.remove(...)
    panel.add(...);
    panel.revalidate(...)

  • Backup DC past tombstone and need help replacing it with another DC with the same name and IP

    Hey Everyone
    We have a single domain in a forest with 2 DCs with AD integrated DNS configured. The primary DC with all the FSMO roles is a VM (Server 2008 R2) and the backup DC is a physical server (Server 2008 non-R2).
    The backup DC's hardware is very old and has been giving us a lot of issues where the system would intermittently BSOD, freeze, black screen only etc. and as a result, the server was turned off for a very long time, definitely beyond the default tombstone
    lifetime of either 60 or 180 days.
    We want to replace this bad backup DC with another physical server which became available as a spare and is much newer and in a working condition hardware wise. We also wish to ultimately give it the same name (FQDN) and IP to basically make it an outright
    replacement for the current bad backup DC.
    My questions are:
    1.) If we are in a position where the bad server could possibly physically boot and start the operating system and have network connectivity, will we be able to use DCPROMO as one would normally do to demote this DC, or will it have to be done forcefully,
    while keeping in mind as I said that the DC is way past the tombstone lifetime period?
    2.) If it has to be done forcefully, I am aware that the meta data needs to be cleaned up in AD on the working primary DC, although I have never performed such a process before. If this is done, are there any other things I need to look out for or do
    before I attempt to replace it with the other server which I will set up wit the same name (FQDN) and IP, then add to the domain, and then lastly promote as per normal using DCPROMO?
    I know we will have to upgrade the scema to 2012RM as the replacement backup DC will be running this newer operating system.
    Anything else you wish to add or point out to me would be highly appreciated. Thank you in advance.
    Regards,
    CTV

    Hi,
    I would suggest please do the metadata cleanup using the script and then remove object from below DNS console and then run the repadmin /syncall /Aed
    https://gallery.technet.microsoft.com/scriptcenter/d31f091f-2642-4ede-9f97-0e1cc4d577f3
    Repeat running the vbs script till the wrong/unnecessary dc’s are removed.
             Cross check the removal – dsa.msc [ad users and computers] > Domain Controllers OU
     Adsiedit.msc
     Expand domain partition, select OU=Domain Controllers, make sure only the necessary domain controllers are listed.
     Delete the incorrect domain controllers.
    Dnsmgmt.msc [Dns Management]
          Expand the forward lookup zones\_msdcs folder
    i.      Make sure only the actual domain controllers are listed, delete wrong Alias recordsremove wrong name server records
    ii.      Select the container [forward lookup zones\_msdcs.domain.com\dc\_sites_\sitename\_tcp] > delete incorrect _ldap and _kerberos records are listed.
    iii.      Select the container [forward lookup zones\_msdcs.domain.com\dc\_tcp] and delete incorrect _ldap and _kerberos records
    iv.      Expand the [forward lookup zones\_msdcs.domain.com\domains\guid\_tcp] and delete incorrect _ldap entries
    v.      Select [forward lookup zones\_msdcs.domain.com\gc] – delete incorrect HostA records
    vi.      Expand the [forward lookup zones\_msdcs.domain.com\gc\_sites\sitename\_tcp] – delete incorrect _ldap entries
    vii.      Select the [forward lookup zones\_msdcs.domain.com\gc\_tcp] – delete incorrect _ldap entries
    viii.      Select the [forward lookup zones\_msdcs.domain.com\pdc\_tcp] – delete incorrect _ldap entries
          Expand the forward lookup zones\domain.com folder
    i.           
    Delete Host(A) records of dc’s which are non-existant.
    ii.           
    Correct the NameServer (NS) records
    iii.           
    Follow steps similar to ’ A ii ‘ >> ‘ A viii’
             Dssite.msc [Sites and Services]
          Expand the [Sites\Sitename\Servers] – delete incorrect server’s
    B.      Delete incorrect subnet configurations [Sites\Subnets]
          Delete incorrect site links [Sites\IP]

  • I am using OSX 10.9.5 and Outlook Web App for emails. When I download an attachment it replaces the space in the file name with   - how can I change this?

    I am using OSX 10.9.5 and Outlook Web App for emails. When I download an attachment it replaces the space in the file name with %20  - how can I change this?

    Click on the below link :
    https://get.adobe.com/flashplayer/otherversions/
    Step 1: select Mac OS  X 10.6-`0.`0
    Step 2 : Safari and FIrefox
    Then click on " Download Now"  button.

Maybe you are looking for