Is there a default focus Method ?

I would like to have a button to be focused by default within a dialog such that user can easily fire the button's action. Is there a method to set default focus on a button ? Thanks !!!

That's actually very helpful. I can now set a default focus button on a dialog. But then for some reason I can not set it for other dialogs initiated by this dialog. Since I have an opening dialog with a number of buttons, and those buttons will open up a new dialog. Right now I can only set the default focus to the opening dialog. The other dialogs that opens up from firing the buttons did not have the same effect as the opening dialog. Is there a way to fix it ? Thanks

Similar Messages

  • Default focus behavior in Swing

    I have a JTabbedPane wherein every tab has a variety of fields, including buttons, text areas, text fields, tables, and so on. I wanted to tweak the default focus behavior such that the first text field or the first text area has the focus.
    I used requestFocusInWindow() to set the focus on the first text field I get. This, however, was being overriden at a later stage (I am working on a vast code) and the first component inside a tab is getting the focus.
    Is there any means to override the default focus behavior? I tried writing my own FocusTraversalPolicy but found that that is never used. How does the default focus behavior work? Does it set the focus on the first field it gets or what? And where can I find the code for the same?

    I used requestFocusInWindow() to set the focus on the first text field I get. The requestFocusInWindow() method only works when the GUI is already visible. So I would suggest that you add a ChangeListener to the tabbed pane and add your code to set the focus every time the tab is changed.
    For a slightly different approach the code in this posting will remember the last field for each tab that had focus and reset focus to that field when the tab is changed. The code is not completely off topic since it shows how to use a ChangeListener:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=570369

  • Changing the application wide default focus traversal policy

    Hi,
    I have a Swing application built using JDK1.3 where there lots of screens (frames, dialogs with complex screens - panels, tables, tabbed panes etc), in some screens layouts have been used and in other screens instead of any layout, absolute positions and sizes of the controls have been specified.
    In some screens setNextFocusableComponent() methods for some components have been called at some other places default focus traversal is used. (which I think is the order in which the components are placed and their postions etc). Focus traversal in each screen works fine.
    Now I have to migrate to JDK1.4. Problem now is that after migrating to JDK1.4.2, focus traversal has become a headache. In some screens there is no focus traversal and in some there is it is not what I wanted.
    So I thought to replace applicaiton wide default focus traversal policy and I did the following:
    ///////// Replace default focus traversal policy
    java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalPolicy(new java.awt.ContainerOrderFocusTraversalPolicy());
    But there is no change in the behaviour.
    Then I tried following:
    ///////// Replace default focus traversal policy
    java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalPolicy(new java.awt.DefaultFocusTraversalPolicy());
    I did all this in the main() method of the application before anything else just to ensure that all the components get added after this policy has been set. But no luck.
    Does someone has any idea what is the problem here ? I do not want to define my own focus traversal policy for each screen that I use (because thats lot of codes).
    Thanks

    not that hard if you only have the one focus cycle ( > 1 cycle and it gets a bit harder, sometimes stranger)
    import javax.swing.*;
    import java.awt.*;
    class Testing
      int focusNumber = 0;
      public void buildGUI()
        JTextField[] tf = new JTextField[10];
        JPanel p = new JPanel(new GridLayout(5,2));
        for(int x = 0, y = tf.length; x < y; x++)
          tf[x] = new JTextField(5);
          p.add(tf[x]);
        final JTextField[] focusList = new JTextField[]{tf[1],tf[0],tf[3],tf[2],tf[5],tf[4],tf[7],tf[6],tf[9],tf[8]};
        JFrame f = new JFrame();
        f.setFocusTraversalPolicy(new FocusTraversalPolicy(){
          public Component getComponentAfter(Container focusCycleRoot,Component aComponent)
            focusNumber = (focusNumber+1) % focusList.length;
            return focusList[focusNumber];
          public Component getComponentBefore(Container focusCycleRoot,Component aComponent)
            focusNumber = (focusList.length+focusNumber-1) % focusList.length;
            return focusList[focusNumber];
          public Component getDefaultComponent(Container focusCycleRoot){return focusList[0];}
          public Component getLastComponent(Container focusCycleRoot){return focusList[focusList.length-1];}
          public Component getFirstComponent(Container focusCycleRoot){return focusList[0];}
        f.getContentPane().add(p);
        f.pack();
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }

  • Default payment method issue in Additional Off-Cycle Payments

    Hello everyone,
    I have an issue with Additional Off-Cycle Payments and running this in payroll driver.
    I have maintained V_T52OCB  or "Define default values for payment methods" in IMG as Check (C) but when I run payroll for this employee I see that payroll driver is considering Infotype 0009 which is a direct deposit but when I run the same employee in OFF-CYCLE Workbench I see that the run is defaulted to Check and is not considering Infotype 0009 which is correct.
    What I don't understand is the same record when processed through regular payroll driver (RPCALC) is considering Infotype 0009 but Off-cycle is considering default payment method for Off-Cycle defined in IMG.
    Has anyone seen this kind of issue?
    Thanks,
    Hemanth.

    Hello Hemanth,
    The value you maintain in V_T52OCB  is only for defaulting the Payment type in Offcycle Workbench Screen for the Reason you have choosen for the offcycle, it doesn't mean it would be run only by that payment type and you can overrite in offcycle workbench itself by choosing the other payment type.
    For Offcycle run it always with the value entered in IT 0009, For off-cycle, if there is a valid record with subtype 5/6, it will be used otherwise subtype 0/1 will be used if payment method selected is according to IT.
    If payment method is not according to IT a new record will be created in IT 0009 for the exact date.
    For Manual check, the check number can be entered in Offcycle workbench.
    I hope it clarified your doubt.
    With Regards,
    S.Karthik

  • F110 - default payment method based on document currency

    Hi all
    I would like to know if there is anyway we can control the payment method based on the Document currency. Our co code currency is USD..
    In our client's system they dont maintain the payment method in the line item, as its difficult for them to do so due to the large number of line items.
    Currently they have 2 payment methods ( T - Tele transfer & C - Check)..
    They wanted to know if they can default a payment method (C Check) whenever a invoice in SGD is paid through the automatic payment program. Invoices in USD are to be paid using T - Tele transfer.
    But they dont want to maintain the payment method (C Check) manually in the line items.
    In the vendor master they maintain both T & C payment methods.. and also in the parameters screen in F110 they maintain (T,C) in payment method field.
    Can anyone please let me know if there is any way I can pay all the documents posted in SGD through Payment method (C).
    Thanks in advance.
    Krishna

    Hi,
    One thing you can do....if you are creating Invoice through MIRO....at the time of creating the Invoice you can put the payment method C in payment Tab ......so the system will take a default payment method C at the time of Payment.
    If you use Fb60 or F-43 you can put payment method C at the time of creating invoice.
    With regards,
    Sudipto

  • Default Activity Method call in TF not executing (in ADF Lib)

    Hi,
    We have created a ADF Lib of a reusable task flow.
    The Task Flow contains two activities
    (i) A method call {which is default activity and this method belongs to a datacontrol}
    (ii) A view activity (which is a jsff)
    Now everything works fine if I am using the TF as a region in same project.
    But if I create a ADF Lib of it and implement the same to other application (the new application have same datacontrol and method) the default activity "which is method in our case" is not getting executed, rather the jsff executes first.
    I am using Jdev 11.1.1.4
    Thanks.

    Hi Frank,
    Thanks for reply.
    But, I have provided the same functionality to DataControl, which was working for TF included project.
    Apart from that, program control didn't visit the the default activity method body, hence its sure that it never got executed.
    Is there any way I can trace it !!

  • Auto tab focus method is not working in iOS devices please share the ideas why its not working?

    Auto tab focus method is not working in iOS devices. Please share the idear i am facing this issue while developing code for devices.

    Hi there,
    I can confirm this bug.
    Not sure if this info is relevant, but this is my experience:
    I am on the FIDO network, and so are two other people I know.
    We all tried blocking numbers, and calls ring right through. Text messages are blocked successfully. (never tried facetime)
    I also tried a ROGERS device running IOS7, and was successfully able to block my phone call from ringing through. HOWEVER, my call was forwarded to their voicemail, I was able to leave a voicemail for the person, and they did get an alert that they had a new voicemail.
    I have not yet had a chance to test this on Bell, Telus, or any other carriers.
    Spoke to Apple, and they advised me to do a hard reset (hold both buttons to shut off and reboot the phone), and if that fails to do an iOS restore.
    I have yet to try this, but hopefully someone will have a better solution.

  • Is there any default size for ArrayList

    The default capacity of Vector is 10.
    Is there any default size for ArrayList ??
    Vector v = new Vector();
    System.out.println("==> "+v.capacity()); // output is ==> 10
    java.util.List alist = new ArrayList();
    System.out.println("==> "+v.capacity()); // here the out put is ==> 0
    Regards
    Dhinesh

    No default size for arraylist.initially it's zero.
    I think u r comparing capacity with a size those two are different.
    Size- represents number of elements in the array.
    capacity- the capacity is the size of the array used to store the elements in the list. It is always at least as large as the list size. As elements are added to an ArrayList, its capacity grows automatically.
    it depends on the ensureCapacity() method in the arraylist.

  • 5800 loses default connection method

    In Connectivity/Destinations, I have "Internet" as my default connection method, this is denoted by a tiny little tick at the side of it.
    But every now and then, it will fail to connect, and when going into Connectivity/Destinations, the little tick has gone.
    This is my 3rd 5800 and the 3rd one to do this.. any ideas why ?

    If there are mobile networks on the default container, if you lose the connection to wifi, it would revert to that and may cost you...Hmm..never experienced this before....try to restore factory settings.
    If you find my post helpful please click the green star on the left under the avatar. Thanks.

  • Problem defaulting shipping method in Sales Order form

    Hi,
    I need to defaulting shipping method based on subinventory code value.
    e.g :
    Subinventory -- Shipping Method
    N100 -> HN1
    N120 -> HN2
    I try to use form personalization on when-validate-record of line block, but never updated.
    If i prompt the message, it will display the updated value but after that it will display the old value again.
    I shifting the code to workflow at the time its booked and its working. But problem is, the user can still change the subinv after booked which is outside the workflow already.
    Appreciate if anyone can have solution for this.
    TIA,
    Fendy

    For defaulting fields on sales orders, instead of personalizations or workflow changes,check if you can use Oracle's defaulting rule functionality. It is meant for such requirements. It is much more powerful and kicks in every time order is created (either from screen or via order import).
    OM Superuser > setups > rules > defaulting rules
    Look at JohnnyP's post in Selecting the Subinventory for orders shipped from the LAO warehouse for details on how to do that.
    Hope this helps,
    Sandeep Gandhi

  • My iPad camera photos will wirelessly sync with my iMac and iCLoud photo stream, but the videos do not, is USB connection the only way to transfer videos or is there also a wireless method?

    My iPad camera photos will wirelessly sync with my iMac and iCLoud photo stream, but the videos do not, is USB connection the only way to transfer videos or is there also a wireless method?

    Videos are not included with the Photo Stream. Photo Stream is for photos only.
    There is not a wireless method for importing videos from the iPad's Camera Roll.

  • How to set default payment method for Supplier using API

    Hi All,
    I am doing data conversion and loading suppliers using ap_vendor_pub_pkg.create_vendor api. But, I cannot see any payment_method_lookup_code column in the RECORD type AP_VENDOR_PUB_PKG.r_vendor_rec_type.
    how do I assign a default payment method to a vendor ?
    Thanks
    Shankar

    Seems like an ER with Oracle Support.
    Bug 11895105: ADDING PAYMENT_METHOD_LOOKUP_CODE FOR AP_VENDOR_PUB_PKG.UPDATE_VENDOR_SITE
    Currently system doesnt allow you to update the PAYMENT_METHOD_LOOKUP_CODE in AP_VENDOR_PUB_PKG.Update_Vendor_Site.Because above column does not define in l_vendor_site_rec regardless other procedure.

  • Need help finding the default payment method for supplier site in R12

    I am using the following query to find out what the default payment method is for a supplier site.
    select pv.vendor_id ,
    pvs.vendor_site_id,
    iepa.ext_payee_id,
    ieppm.payment_method_code
    from ap_supplier_sites_all pvs
    ,ap_suppliers pv
    ,iby_external_payees_all iepa
    ,iby_ext_party_pmt_mthds ieppm
    where pv.pay_group_lookup_code = 'EMPLOYEE'
    and pv.vendor_type_lookup_code = 'EMPLOYEE'
    and pv.employee_id is not null
    and pv.employee_id =92584--p_person_id
    and pv.vendor_id= pvs.vendor_id
    and pvs.vendor_site_code = 'HOME'
    and pvs.pay_group_lookup_code <> 'ATTACHMENT'
    and ((pv.end_date_active is null) or (pv.end_date_active >= sysdate))
    and ((pvs.inactive_date is null) or (pvs.inactive_date>= sysdate))
    and pvs.pay_site_flag = 'Y'
    and pvs.vendor_site_id = iepa.supplier_site_id
    and iepa.ext_payee_id = ieppm.ext_pmt_party_id
    and ieppm.primary_flag = 'Y'
    and pv.segment1 = '131678'
    The problem is that I am returning two rows.
    I have gone in to the application and changed the default payment method from 'Check' to 'Electronic' and I am able to see the change on one of the records, however I am unable to determine how I'm supposed to narrow it down to just this record. I am pulling what hair I have left out!
    Please help.
    Chris

    Here is the generic query for some one who is faing problem like us.This query will return all the payment methods for all sites of a supplier
    SELECT ieppm.payment_method_code,ieppm.inactive_date
    FROM ap_supplier_sites_all assa,
    ap_suppliers ass,
    iby_external_payees_all iepa,
    iby_ext_party_pmt_mthds ieppm
    WHERE ass.vendor_id = assa.vendor_id
    AND assa.pay_site_flag = 'Y'
    AND assa.vendor_site_id = iepa.supplier_site_id
    AND iepa.ext_payee_id = ieppm.ext_pmt_party_id
    AND ass.segment1 = '10033' -- Supplier Number
    AND( (ieppm.inactive_date IS NULL)or (ieppm.inactive_date > sysdate)) ;

  • Default Focus on TextField

    Hello All,
    I have got a problem, please help me. I have a textfield in a frame. When call that frame the textfield will be displayed with default focus on it. I dont want to have the cursor in that text field. I dont have any other swing components in that and the text field is the first component in that frame.
    Please help me....
    Thanks in advance

    Hello
    Thanks for your reply. But i my code is some thing like this.
    public class TextFieldExample extends JFrame
         public JTextField textField;
         public JButton enterButton;
         public TextFieldExample()
              super();
              textField = new JTextField(25);
              JPanel jp = new JPanel();
              jp.add(textField);
              getContentPane().add(jp);
              setLocationRelativeTo(this);
              pack();
         public static void main(String args[])
              TextFieldExample textFieldExample = new TextFieldExample();
              textFieldExample.setVisible(true);
              textFieldExample.addWindowListener(new WindowAdapter()
                   public void windowClosing(WindowEvent we)
                        System.exit(0);
    Now Please suggest me the solution.

  • I want to change my account payment method to none and I do not have a credit card yet.Plus, iTunes gave a message saying that I need to review my account and when I go there,the none payment method is hidden.

    I want to change my account payment method to none and I do not have a credit card yet.Plus, iTunes gave a message saying that I need to review my account and when I go there,the none payment method is hidden.

    Assuming that you want help and that you aren't just copying-and-pasting that thread's title and posting a link to it, then have you tried the steps on the post that I linked to in my first reply on that thread ?
    If you don't get the 'none' option when trying those instructions then you will need to enter credit card details before you will be able to use the account - when you've entered credit card details you should get the 'none' option and be able to remove your card details.
    Or you can create a new account, and follow, exactly, the steps on this page when creating it' : http://support.apple.com/kb/HT2534

Maybe you are looking for

  • HT204053 Can you merge multiple Apple IDs?

    I have somehow collected 3 IDs over the years and want to merge them so I don't keep having to log out and resign in every time I need to update my apps on my iPhone and iPad. Any thoughts? Thanks!

  • Upgrade HD in MacBook Pro 3.1?

    I have a  MacBook Pro "Core 2 Duo" 2.2 15-Inch (Santa Rosa) with a 120 GB HD. I'd like to replace it with a new HD that's around 500 GB. or more. Seagate makes a Momentus XT drive that's a combination regular HD with a small solid state drive. Any go

  • Generating HTML Files via RECEIVER File Adapter

    Hi All, I have the Following Scenario:  R/3 ( ABAP Proxy ) - >XI------>HTML Files ( File Adapter ).   Basically I would like to generate, HTML files out the RECEIVER File Adapter.   How can this be achieved? I  have invested some time in thinking abo

  • Obsolete account/password

    Whenever I go to buy a new app for my iPhone 4, at installation the store returns a message demanding the password attached to an account that has been obsolete for two years.  Thus, the purchase never goes through.  I cannot see a way to update to m

  • Sync help total assests and offsite website

    I do not have broadband ( use exclusively wifis, in LA, most of the time 100 kbps ( terrible) but am terrified to use sync so I can use the cloud as I have many unlinked and unused, but for  the future, files and docs on my off site website which is