TAB to get next focus

Hello Guys,
I have a problem that I would really like some help with.
I have a JPanel set to layout null. I have added some components to this panel. the problem arises when I try to use the tab key to traverse accros the components...I get no respose. I have tried to search the web to solve this problem with no luck. I am not even able to catch the tab button with a key listener no matter how hard I try.
Here is the code
public class CreBuy extends JPanel {
               public CustomGUI.ToolTipPanel panToolTip;
               public ThreeButton btnClose;
               public CustomGUI.TextFieldForm txtFirstName;
               public CustomGUI.TextFieldForm txtLastName;
               public CustomGUI.TextFieldForm txtBuyerID;
               public CustomGUI.TextFieldForm txtAddress1;
               public CustomGUI.TextFieldForm txtAddress2;
               public CustomGUI.TextFieldForm txtSuburb;
               public CustomGUI.ComboBoxForm choState;
               public CustomGUI.InvisPanelForm panState;
               public StandardImage imgFace;
               public ThreeButton btnNext;
               public ThreeButton btnReset;
               public StandardImage imgBack;
               //public CP1_Database.ClientData clientData;     
               public CreBuy() {
                    this.setLayout(null);
                    this.setSize(693, 444);
                    //this.setMinimumSize(new Dimension(693, 444));
                    //this.setMaximumSize(new Dimension(693, 444));
                    this.setLocation(3, 24);
                    this.setBackground(new Color(255,255,255));
                    StringBuffer buf = new StringBuffer();
                    this.panToolTip = new CustomGUI.ToolTipPanel();
                    this.panToolTip.setVisible(false);
                    this.add(this.panToolTip);
                    this.btnClose = new ThreeButton("Interface2/CreWar/images/btnCloseDown.gif",
                    "Interface2/CreWar/images/btnCloseNormal.gif", "Interface2/CreWar/images/btnCloseUp.gif", 10, 21, 21);
                    this.btnClose.setLocation(667, 4);
                    this.btnClose.setSize(21, 21);
                    this.add(this.btnClose);
buf = new StringBuffer();
buf.append("<html>\n");
buf.append("<BODY style=\"font-family:arial;font-size:100%;color:#000033\">\n");
buf.append("\n");
buf.append("<table height=\"100%\" width=\"100%\" border=\"0\" cellspacing=\"0\"\n");
buf.append("callpadding=\"2\"><td>\n");
buf.append("<center><b style=\"font-size:120%\">First Name</b></center>\n");
buf.append("Please type in the First Name of the <b>Buyer</b> you wish to create. Any characters are allowed.\n");
buf.append("Your name <b>MUST</b> be greater than <b>3</b> in length.<br><br>\n");
buf.append("<b>EXAMPLES :</b>\n");
buf.append("<ul>\n");
buf.append("<li>John\n");
buf.append("<li>TonyG\n");
buf.append("</ul>\n");
buf.append("</td></table>\n");
buf.append("</BODY>\n");
buf.append("</html>\n");
                    this.txtFirstName = new CustomGUI.TextFieldForm(new String(buf),
                         427, 61, 240, 180, this.panToolTip, 5);
                    this.txtFirstName.setSize(300, 20);
                    this.txtFirstName.setLocation(124, 61);
                    this.add(this.txtFirstName);
                    buf = new StringBuffer();
buf.append("<html>\n");
buf.append("<BODY style=\"font-family:arial;font-size:100%;color:#000033\">\n");
buf.append("\n");
buf.append("<table height=\"100%\" width=\"100%\" border=\"0\" cellspacing=\"0\"\n");
buf.append("callpadding=\"2\"><td>\n");
buf.append("<center><b style=\"font-size:120%\">Last Name</b></center>\n");
buf.append("Please type in the Last Name of the <b>Buyer</b> you wish to create. Any characters are allowed.\n");
buf.append("Your name <b>MUST</b> be greater than <b>3</b> in length.<br><br>\n");
buf.append("<b>EXAMPLES :</b>\n");
buf.append("<ul>\n");
buf.append("<li>John\n");
buf.append("<li>TonyG\n");
buf.append("</ul>\n");
buf.append("</td></table>\n");
buf.append("</BODY>\n");
buf.append("</html>\n");
                    this.txtLastName = new CustomGUI.TextFieldForm(new String(buf),
                         427, 88, 240, 180, this.panToolTip, 5);
                    this.txtLastName.setSize(300, 20);
                    this.txtLastName.setLocation(124, 88);
                    add(this.txtLastName);
//ETC.....
                    this.btnNext = new ThreeButton("Interface2/CreWar/images/btnNextDown.gif",
                    "Interface2/CreWar/images/btnNextNormal.gif", "Interface2/CreWar/images/btnNextUp.gif", 4502, 21, 21);
                    this.btnNext.setLocation(541, 379);
                    this.btnNext.setSize(150, 32);
                    this.add(this.btnNext);
                    this.btnReset = new ThreeButton("Interface2/CreWar/images/btnResetDown.gif",
                    "Interface2/CreWar/images/btnResetNormal.gif", "Interface2/CreWar/images/btnResetUp.gif", 4503, 21, 21);
                    this.btnReset.setLocation(541, 411);
                    this.btnReset.setSize(150, 32);
                    this.add(this.btnReset);
                    this.imgFace = new StandardImage("Interface2/CreBuy/images/imgFace.gif");
                    this.imgFace.setSize(138, 138);
                    this.imgFace.setLocation(522, 62);
                    this.add(this.imgFace);
                    this.imgBack = new StandardImage("Interface2/CreBuy/images/imgBack.gif");
                    this.imgBack.setSize(693, 444);
                    this.imgBack.setLocation(0, 0);
                    this.add(this.imgBack);
               }I know the problem isnt with the custom components as I have tried to tab when using normal JTextField with the same problem.
Does anyone know what I am doing wrong or how I can at least catch the TAB key to invoke the next focus manually?
thanks for your help
Dale Miller

Hi,
try this, it seems to work for me:
public class EnterIsTabJTable extends JTable
    protected void processKeyEvent(KeyEvent e)
        if ( e.getKeyCode() == KeyEvent.VK_ENTER )
            e.setKeyCode(KeyEvent.VK_TAB);
        super.processKeyEvent(e);
}

Similar Messages

  • When i open a new tab i get a tab with 2 blue bars, instead of one - the one on top of the site - and a little firefox dropdown - and when i start the next session firefox crashes???

    When clicking a link - a new tab opens. But the new tab which opens looks wired: There are 2 blue bars - the one you get on each session(where the red x is which closes everything) - I don`t know how you call this. This 2nd blue bar is located directly under the "normal" one and has got - on the left hand side- a firefox dropdown menue(when you click it you get: New Tab, Start private browsing, edit, save page as and so on.
    I can close the session as always but when i start the next session a view hours or a day later then firefox opens all the tabs from the session before as individual windows - and then it crashes. This happens 2 or 3 times - then i see a window where i am asked to either restore the old session(which doesn`t work - it always crashes again) or start a new session - which works.
    This is very annoying. Please tell me what to do.
    Thank you
    richard

    It is possible that there is a problem with the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    Delete the files sessionstore.js [2] and sessionstore.bak in the Firefox Profile Folder.
    * Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.<br />
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    See also:
    * [1] http://kb.mozillazine.org/Session_Restore
    * [2] http://kb.mozillazine.org/sessionstore.js

  • How do I get tabs to open next to current tab?

    How can I get a new tab to open next to the current tab without switching to the new tab instead of having the new tab open at the end of all open tabs and switching to the new tab?
    == This happened ==
    Every time Firefox opened

    Right click the FireFox button in your toolbar and look in the properties- middle tab...make sure that it only has "C:\Program Files\Mozilla Firefox\firefox.exe" with no other link added to the end. I had a similar problem this morning and found a website had attached it's link to the end so it would always pop up first and would only open a new tab.
    Hope that fixed it.

  • Stopping tab from moving to the next focus component

    I have a single TextInput field in my component and I want to
    stop the tab key from advancing the focus when I have an error in
    the field. I have tried using setFocus() and that seems to do it
    although I lose the caret in the text input field. Also when I tab
    I notice that even though I am telling the component that the next
    focus is the TextInput field it still goes to the Internet Explorer
    address bar. Any ideas?

    Append the system's line separator usingjava.lang.System.getProperty( "line.separator" );Then the added line will be placed as you've wanted. Code will be written like below:yourTextArea.append( System.getProperty( "line.separator" ) );
    yourTextArea.append( yourStringToAppend );Hope it helps.

  • Warranty tab not getting displayed in service order

    DEAR ALL,
    I have an issue with crm services, I HAVE NOT ACTIVATED/USED INSTALL BASE IN MY SCENARIO AND HAVE CREATED PRODUCTS DIRECTLY/ DOWNLOADING FROM R/3.
    NOW WHEN I MAKE A SERVICE ORDER THEN WHEN I ENTER THE PRODUCT (EG: FINISHGED GOOD) ITEM CATEGORY BEING YANN (TEXT ITEM CREATED BY US) THEN THE WARRANTY TAB IS NOT COMING UP.
    when we add an expense item in the next line item warranty tab is getting displayed.
    KINDLY HELP.
    REGARDS,
    AMIT

    Hi for this u can use VCT but you to check for doc flow action settings and work flow before, then only you will get Guranty Data tab hope this will helpful
    Regards
    Venkat

  • How to Get the focus of the textbox.

    Hi all,
    I have a problem in getting the focus of the textbox, The scenario is in this way,
    I have 3 textboxes in a window, each one should should get enabled one after the other only (i.e) Textbox2 should be enabled only after Textbox1 is filled and pressed the TAB button and Textbox3 is enabled only after Textbox2 is filled and pressed the TAB button. Textbox2 is also enabled when the cursor is in Textbox3 and SHIFT+TAB is pressed,
    I tried this with the Focus Listener but i cant able to get the cursor in the textbox. Please help in this, how to do this.
    Thanks in Advance.

    844031 wrote:
    Hi all,
    I have a problem in getting the focus of the textbox, The scenario is in this way,
    I have 3 textboxes in a window, each one should should get enabled one after the other only (i.e) Textbox2 should be enabled only after Textbox1 is filled and pressed the TAB button and Textbox3 is enabled only after Textbox2 is filled and pressed the TAB button. Textbox2 is also enabled when the cursor is in Textbox3 and SHIFT+TAB is pressed,
    I tried this with the Focus Listener but i cant able to get the cursor in the textbox. Please help in this, how to do this.
    Thanks in Advance.Hello user,
    If you are talking about 'TextBox' of javafx then please start a new thread on Javafx Category here:JavaFX 1.x and JavaFX Script [ARCHIVE]
    Thanks.,
    narayan

  • The latest version of Firefox no longer asks if you want to save open tabes for your next session..I HATE not having that option. What were they thinking?

    Question
    The latest version of Firefox no longer asks if you want to save open tabs for your next session..I HATE not having that option. What were they thinking? (I think this is self explanatory)

    Firefox 4 saves the previous session automatically, so there is no longer need for the dialog asking if you want to save the current session.<br />
    You can use "Firefox > History > Restore Previous Session" to get the previous session at any time.<br />
    There is also a "Restore Previous Session" button on the default <b>about:home</b> Home page.<br />
    <br />
    Another possibility is to use:
    * [http://kb.mozillazine.org/Menu_differences Firefox (Tools) > Options] > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time"

  • How can I use the enter key instead of tab to change field focus?

    I am using Acrobat 9 Pro.
    We have a fillable PDF where the users enter numbers into fields.  They want to be able to use the <enter> key on the 10-key pad instead of the <tab> key on the keyboard to move the focus to the next data entry field.
    How can I set my PDF so that it recognizes the <enter> key instead of the <tab> key for changing focus?
    Thanks!

    You can use a custom Keystroke script, something like:
    // Custom Keystroke script for text field
    if (event.willCommit && event.commitKey === 2) {
        getField("Text2").setFocus();
    Where "Text2" is the name of the next field. This doesn't disable the Tab key though. For more information, see: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.608.html

  • When I open news or other sites in tabs, I get "Problem loading page" errors on all tabs that I attempted to open.

    I just upgraded to Firefox 20.0 as you "suggested" and now whenever I try to open a new site in a new tab, I get the error "Problem loading page". However, if I open them in new windows, they come up just fine. What have you done to a reasonably running browser?

    I can't think of any reason for a new window to load well but not a new tab. It could be the second try effect. Firefox sometimes seems to give up on a site instantly, but if you reload, everything is fine. Could you try a reload in the same tab the next time and see whether that works? Not that it's a good workaround, but just to get a better idea of what's happening.

  • Ms Excel move automatically without pressing Enter or Tab to the next cell

    Hi, I wonder if it is possible to make Ms Excel move automatically without pressing Enter or Tab  to the next cell once a certain number of digits is entered, for example, I'm using a barcode scanner to scan a barcode of 13 digits, so I want Excel
    to move to the next cell once the barcode is scanned.
    example: I'm In cell A1,  this code appeared after scanning "AABB1234567CC", I want Excel to move to A2 in order to scan the next barcode.

    Hi,
    Excel has no direct feature or option to achieve your goal. We'd better try the macro via VBA code to test. Please see the thread:
    http://excel.tips.net/T003923_Automatically_Moving_from_Cell_to_Cell_when_Entering_Data.html
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    If you have further question about code, I recommend you follow with thread which you posted in MSDN forum:
    http://social.technet.microsoft.com/Forums/en-US/6f5344cf-c1b5-485d-982a-eeec45294f9b/ms-excel-move-automatically-without-pressing-enter-or-tab?forum=exceldev
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Applying the Shortcut key Tab to JTextField to focuse one by one

    how are we Focusing the JTextField one by one by using the Shortcut Key Tab,as per our specified ordering of JTextFields.
    In my application,i used the Shortcut key Tab for JTextField by focusing the JTextFields for each JTextField key event...but i could not get the result successfully.Do u have solution means u reply me plz.......

    as per our specified ordering of JTextFields.set your own FocusTraversalPolicy()
    http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html#customFocusTraversal

  • Next focusable componentwhen using a text pane

    I am using nextFocusableComponent and it works grand with textFields but how do I use it with a textPane. By pressing tab it will just go onto a new line. I want it to tab to the next item. I want to use "return/enter" to get the next line on the text pane.

    Swing related questions should be posted in the Swing forum.
    Here is my answer for a JTextArea. I assumes its the same for a JTextPane:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=609727

  • Popup - how to get the focus in a specific compent

    Hi,
    I am trying to get the focus of my pop-up in the second component.
    Use case: New button in the table shows a popup to get the input from the user. There is a Undo Edit link (top-left) to discard changes, on top of the pop-up so by default the focus goes to the top left. I have input text boxes under that. And I am trying to get the focus (mouse cursor) in the first input text box rather than the undo Edit link. Any idea to implement that without using javascript ?
              <af:popup id="newPopup" contentDelivery="lazyUncached"
                        popupCanceledListener="#{commonUtils.CreatePopupCanceledListener}">
                <af:dialog id="createPopupDL" type="none"
                           title="#{viewcontrollerBundle.NEW_COURSE_PLAN_STRUCTURE_QUALIFIER_HEADER}"
                           resize="on">
                  <af:separator id="s1"/>
                  <af:panelGroupLayout id="pgl2" layout="vertical" halign="left">
                    <af:panelGroupLayout id="pgl3" layout="horizontal">
                        <!-- csc:undoEdit is a custom component to undo change
                        By default the focus is coming to this component -->
                      <csc:undoEdit id="ue1"/>
                    </af:panelGroupLayout>
                    <af:messages id="m1"/>
                    <af:spacer width="10" height="10" id="s2"/>
                    <af:panelFormLayout id="pfl1" labelAlignment="start"
                                        labelWidth="140">
                      <af:spacer width="10" height="10" id="s3"/>
                          <!-- I want to get my mouse cursor in this box -->
                          <af:inputText id="it2"
                                    label="#{bindings.QualifierCd.hints.label}"
                                    value="#{bindings.QualifierCd.inputValue}"
                                    showRequired="true"
                                    required="#{bindings.QualifierCd.hints.mandatory}"
                                    columns="#{bindings.QualifierCd.hints.displayWidth}"
                                    maximumLength="#{bindings.QualifierCd.hints.precision}"
                                    shortDesc="#{bindings.QualifierCd.hints.tooltip}"
                                    autoSubmit="true">
                        <f:validator binding="#{bindings.QualifierCd.validator}"/>
                      </af:inputText>
                    </af:panelFormLayout>
                  </af:panelGroupLayout>
                  <af:spacer width="10" height="10" id="s4"/>
                  <af:separator id="s5"/>
                  <f:facet name="buttonBar">
                    <af:group id="g2">
                      <af:panelGroupLayout id="pgl4" layout="horizontal"
                                           halign="start">
                        <af:commandButton text="#{smsCommonViewBundle.CreateBtn}"
                                          id="createCB" action="doCommit"
                                          partialSubmit="true"
                                          accessKey="#{smsCommonViewBundle.CREATE_ACCESS_KEY}">
                          <f:actionListener type="au.com.callista.sms.framework.view.lifecycle.PopupDismissActionListener"/>
                        </af:commandButton>
                        <af:spacer width="10" height="10" id="s6"/>
                        <af:commandLink text="#{smsCommonViewBundle.CANCEL_LNK}"
                                        id="cancelCL" action="doCancel"
                                        accessKey="#{smsCommonViewBundle.CANCEL_ACCESS_KEY}"
                                        immediate="true">
                          <f:actionListener type="au.com.callista.sms.framework.view.lifecycle.PopupDismissActionListener"/>
                          <af:resetActionListener/>
                        </af:commandLink>
                        <af:spacer width="400" height="10" id="s9"/>
                        <af:icon name="required" id="i1"/>
                        <af:spacer id="sp3" width="5" height="0"/>
                        <af:outputText value="#{smsCommonViewBundle.requiredLbl}"
                                       id="ot1" styleClass="requiredText"/>
                      </af:panelGroupLayout>
                    </af:group>
                  </f:facet>
                </af:dialog>
              </af:popup> Edited by: user9319679 on Sep 6, 2011 10:43 AM

    I dont think so that possible without javascript.. AFAIK
    <af:clientListener method="setFocus()" type="load"/>
          <af:resource type="javascript">
               function setFocus(event){
                 var input1 = document.getElementById('pt1:r1:3:pt1:it1::content'); // the complete id of the inputText - change it according to your jsff.. use firebug to get the proper id
                 if(input1!=null)
                 {input1.focus();
          </af:resource>

  • How to get the focus in a Table Control

    Hello Experts,
                         I have a simple Table control in my screen . I want to know under which column my cursor is ? Basically i want to get the focus the table control . How can i achieve this  ?
    Thanks
    Vivek

    >
    Vivek Joshi wrote:
    > Hello Router ,
    >                      I do not want to set the focus , I want to get focus . User can click on any cell in the table and then press a button in the toolbar . Now in the event handler of the button i want to under which column User has set the focus .
    > I hope , I am clear now .
    > Thanks for your help
    > Regards
    > Vivek
    An yet you keep getting suggestions of how to set the focus.   I looked through the API documentation and I don't see anything that would suggest you can request to see where the current focus is.  Perhaps someone might still come along with a solution, but my hopes wouldn't be too high at this point.  I can pass the requirement onto Product Definition, as the use case does seem interesting.  Perhaps it is something we have even considered in the past. 
    But for now, there might be a better way to solve your problem.  It will probably mean redesign the interaction.  What exactly are your requirements?  Do you need to be able to get the data in a particular cell of table when a button is clicked?  Just throwing out some ideas here, but maybe just use the lead selection to select the row, but then have a button choice to choose the action associated with the column you want. A hack for sure - but it might work.  Also it doesn't help you right now, but in the near future update to NetWeaver 7.0, WDA does have a onColSelect event for the table.

  • How to get the focus at the end of text ?

    I am having applet with awt TextField component and some default text. (MSQ-)
    To have a focus to text field I am using :
    refnoTextField.requestFocus();
    But this gives focus at the biginning and not at the end of text. I want the focus at the end (i.e. after MSQ-)
    How to get the focus at the end of text ?
    any help ?
    manisha
    manisha

    public void focusGained(FocusEvent e) {
         if (e.getSource() == yourtextbox) {
         yourtextbox.setSelectedEnd(yourtextbox.getLength());
    try this thing - not sure if it'll work, but I figgured out how to apply it to my textareas for keeping the focus on the last line of the textarea..it might work for your textboxes..
    shrug

Maybe you are looking for

  • Can't access Shopping Cart since upgrading to 7.0.1

    Since I upgraded iTunes from version 7.0.0 to 7.0.1, I have not been able to access my Shopping Cart. The error appears as follows: "We could not complete your iTunes Store request. An unknown error occurred (5002). There was an error in the iTunes S

  • Slow Printing Startup When Using Windows Vista

    My husband just bought a new HP computer with the Windows Vista OS on it. He has an HP LaserJet 1012 printer. The printer did not work until we downloaded the most recent driver for the printer. Now, it prints, but there is about a 20-30 delay after

  • Two problems with two different classes.

    im having two problems: i get nothing with the printConferences() method inside ReferenceBook class, the arraylist size is equal to zero. and my printSchoolsAndCopies() and schoolsAndCopiesToArray() methods which are inside TextBook class, give excep

  • WCF-SQL adapter issue

    Hi all, I have ne issue with adapter when i am polling data from sqldb the dataset is creating in biztalk how can i add the elements in that,i am using this first time. Regards, Raman

  • Will the new Ipod nano support apps?

    Will the new Ipod Nano (8th Gen) support apps?