Tabbing through components

I have an array of JTextFields in GridBagLayout.
Normally, I wouldn't be having trouble, but I specifically had to lay them out from top-to-bottom(wraping around to the top of the next column), instead of the normal left-to-right layout.
So, what I need Is to be able to tab in the same order, going down first, instead of across.
Thank you,
CINC

I have an array of JTextFields in GridBagLayout.
Normally, I wouldn't be having trouble, but I
specifically had to lay them out from
top-to-bottom(wraping around to the top of the next
column), instead of the normal left-to-right layout.
So, what I need Is to be able to tab in the same
order, going down first, instead of across.
Thank you,
CINC

Similar Messages

  • Tab between Components

    Hi
    In my application I want the user to be able to tab between components. The order should be as follows - tree, radio button, table, button. I have no problem going from tree to radio button to table, but once in the table if you keep pressing tab if just cycles through the rows.
    I use the setNextFocusableComponent(component) method. Here is a snippet of my code :
    tree.setNextFocusableComponent(radioButton);
    radioButton.setNextFocusableComponent(table);
    table.setNextFocusableComponent(button1);
    Any suggestion on how to solve this problem are welcomed
    Thanks
    Bernie-wolf

    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    public class Ex {
        public static void main(String[] args) {
            final JFrame f = new JFrame("Ex");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            final JTable t = new JTable(10,10);
            t.setSurrendersFocusOnKeystroke(true);
            KeyStroke tab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0);
            KeyStroke ctrl_tab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.CTRL_DOWN_MASK);
            KeyStroke[] forward = {tab, ctrl_tab};
            Set forward_set = new HashSet(Arrays.asList(forward));
            t.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, forward_set);
            final DefaultCellEditor editor = (DefaultCellEditor) t.getCellEditor(0,0);
            JTextField editorComp = (JTextField) editor.getComponent();
            editorComp.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, Collections.EMPTY_SET);
            Action myTabAction = new AbstractAction("myTabAction") {
                public void actionPerformed(ActionEvent evt) {
                    editor.stopCellEditing();
                    t.transferFocus();
            editorComp.getInputMap().put(tab, myTabAction.getValue(Action.NAME));
            editorComp.getActionMap().put(myTabAction.getValue(Action.NAME), myTabAction);
            f.getContentPane().add(new JScrollPane(t));
            f.getContentPane().add(new JButton("somewhere else for the focus to land"), BorderLayout.SOUTH);
            f.setSize(400,300);
            f.show();
    }1. I always setSurrendersFocusOnKeystroke(true). Otherwise, the user starts typing, editing begins, but the text field doesn't get focus immediately: no cursor appears, and VK_LEFT and VK_RIGHT cause focus to go to the adjacent cells, instead of moving the cursor within the text field.
    2. As the previous poster notes, JTable recognizes ctrl+tab as a request to move focus to the next component. Unfortunately, this doesn't work when editting a cell. I also have a beef with JTable: VK_LEFT and VK_RIGHT already let you traverse cells, why not let tab move focus to the next component?
    3. Anyway, in my code above, I change the focus travesal keys so that tab works the way the OP wants it, assuming the table has focus.
    4. What if the cell editor's text field has focus? Here my code is hacky, and I hope another poster can improve it. I add an action that (a) stops cell editing (this is what happens when you press enter), then (b) moves focus along.

  • In creating a fillable PDF in XI Pro, can I insert a table which can be tabbed through?

    In creating a fillable PDF in XI Pro, can I insert a table which can be tabbed through?

    You're in luck. Create the first field and then right-click it (in Form Edit mode) and select Create Multiple Copies. You'll be able to specify how many copies of the fields to generate, and at what intervals. The nice thing is that although the properties of the new fields will be identical to the source one, they'll each have a unique name, so you'll get an instant "table" of fields.

  • Date field automatcailly changing when tabbing through other scripted fields

    I have a form with a datetime field. The object is readonly. I format the field with javascript as yyyymmddhhmmss as a tracking number for the form. When tabbing through other fields with javascript the value changes to the current date time, like the code is being executed each time a scripted field is entered.
    Any ideas how to prevent that? I just want the code to execute when the form is opened.
    ----- form1.sbfDirect_Pay.dteCurrentDate::ready:layout - (JavaScript, client) ----------------------
    // Current Date in short-style date format.
    // $.rawValue = num2date(date(), DateFmt(1, "))
    var varCurrentTime = new Date();
    var varYear = varCurrentTime.getFullYear();
    var varMonth = varCurrentTime.getMonth() + 1;
    var varDay = varCurrentTime.getDate();
    var varHour = varCurrentTime.getHours();
    var varMin = varCurrentTime.getMinutes();
    var varSec = varCurrentTime.getSeconds();
    if(varMonth<10) varMonth = "0" + varMonth;
    if(varDay<10) varDay = "0" + varDay;
    if(varHour<10) varHour = "0" + varHour;
    if(varMin<10) varMin = "0" + varMin;
    if(varSec<10) varSec = "0" + varSec;
    // $.rawValue = year + "" + month + "" + day + "" + hour + "" + min + "" + sec;
    dteCurrentDate.rawValue = varYear + "" + varMonth + "" + varDay + "" + varHour + "" + varMin + "" + varSec;

    I think I just answered my own question. The code was in the layout:ready event. This area is executed each time the layout is modified. I moved the code to form:ready event.

  • Tab through cells in a table created in Pages

    In 5.0 when I create a table I cannot tab through the cells. Is there a setting I'm missing here? Why must I use the arrow keys?
    Thanks.

    Thanks. I hadn't considered that and yes it works but not the same way it did before. Prior to the change if you made a change in the cell you could double tab to move onto the next one. Now you must use option + tab after making the change to go onto the next cell.

  • Issue tabbing through form fields on Adobe Reader 9.2

    Hello everyone.  I am having an issue that I am hoping someone can assist me with.  We are currently using IE6 and Reader 5.5 in our production environment and we are currently testing IE8 and Adobe Reader 9.2 for deployment.  Our company uses a web portal where we have many pdf forms that open within a web browser. The problem we are experiencing is that when tabbing through fields on the pdf, the cursor will eventually cycle down to the end of the form and then start cycling through to the top of the browser (toolbars, address bar, search bar,etc) before finally returning to the pdf document's fields.  Is there either a setting in the reader or maybe even IE which controls this functionality and will limit the tabbing to only the pdf form?  Or does anyone know of a method of limiting the tabbing functionality to only work within the pdf document itself when opened within a browser?
    Any help on this is greatly appreciated.  I have looked through all the reader preferences and do not see anything directly related to this.  Thank you very much in advance.

    I guess by QTP you mean HP Functional Testing 11. This is really something to take up with HP, it's the job of monitor software not to crash.

  • Tabbing through form fields in app doesn't work in Firefox.

    Is there a setting in Firefox that permits tabbing through form fields so that one doesn't have to use the mouse? This works fine in IE. for the same app without any configuration, but not in Firefox.

    Are you really still running Firefox 3.6? Since it hasn't received any security updates for nine months, you may be putting yourself at risk.
    In my experience, tabbing through forms works just fine. Have you tested in Firefox's Safe Mode to see whether the problem is caused by a custom setting or add-on.
    First, I recommend backing up your Firefox settings in case something goes wrong. See [https://support.mozilla.org/en-US/kb/Backing+up+your+information Backing up your information]. (You can copy your entire Firefox profile folder somewhere outside of the Mozilla folder.)
    Next, restart Firefox in [http://support.mozilla.org/kb/Safe+Mode Safe Mode] by holding the Shift key when you double-click the program icon.
    In the Safe Mode dialog, do not check any boxes, just click "Continue in Safe Mode."
    If tabbing works correctly, this points to an add-on or custom setting as the most likely cause of the problem.

  • Tabbing through PDF Forms on iPad

    I have a stupid question.
    I've built a bunch of forms in Acrobat Pro XI, and the company I work for provides everyone with iPads for ease of use.  heh.
    Our people are using external keyboards for the iPad to fill out these forms and I've been told that the Tab Key on the keyboard does NOT tab through the field.  Instead they have to use the Next button on the on-screen keyboard.
    Is there a way to get around this?  They are using Adobe Reader on their iPads.
    I do have an iPad, however, I don't have an external keyboard for it - so I can't troubleshoot this. 
    Thanks for any help.  Oh how I loathe this stupid trend.

    ZAGG make a Great KeyBoad Case combination for your iPad. Its slightly miniturized Full sized keyboad it’s a Bluethooh keyboard.  And it actually has the same feel as a Standard Laptop keyboard. It doesn't feel like a Chicklet keyboard. I have one for my iPad. The case is made out of Kevlar.  The key board uses any unversal Power brick that uses a standard USB connector at the brick ined and the micro USB in key board end. I bought the case for mine along with iPad just after the iPad3 came out I have yet to recharge the keyboard.

  • Tab through the Close File dialogue window buttons?

    In the past when closing a document or file (any app) I could Tab through the different 'Don't Save', 'Cancel' & 'Save' buttons on the close file dialogue window. And also hit the spacebar to select the highlighted button.
    But not any more. It could have stopped working when I deleted items (cleaned up?) from my home Library folder, or maybe it happened after the 10.4.10 update?
    Does anyone else have the same problem? (Can you Tab through them & hit the spacebar to select the highlighted button?) Does anyone know how to fix it?

    Select "All controls" at the bottom of the "Keyboard Shortcuts" pane of "Keyboard & Mouse" System Preference. Control-F7 will also turn it on or off.

  • Is tabbing through all the active cells of a table possible?

    hi...
    i need to tab through the active cells which are already not seen on the table. i mean i can only tab through the cells which i see, i need to use the horizontal scrollbar to move to the cells which are not already seen.
    can i programmatically change this behaviour?
    i used the example program below to disable a part of the table.
    http://zone.ni.com/devzone/cda/epd/p/id/2163
    then i noticed this behaviour. hope its the same with arrays also.
    please reply with your valuable suggestions
    thanks in advance
    Renn 
    Kudos always welcome for helpful posts

    Please hav a look at the VI
    Kudos always welcome for helpful posts
    Attachments:
    disabletablecells_test.vi ‏74 KB

  • "Text Boxes" (comments) in my form are included in "tabbing" through fields while filling in a form

    I have included several text boxes (not text fields) in my form. They are adjacent to the fields that are being filled in and serve various comment functions that I do not want in the printed form at the end.
    If the user "tabs" through the fields to enter data in the next field the 'text boxes' (comments) are included in the tab stops... I can not see where to turn that off. I want the tab order key to ignore the comment fields - the text boxes. They are not even listed in the tab order menu.
    Also - is there a way a field that shows up multiple times in a form (duplicate field) can be skipped by the tabbing through IF it aleady has data in it?

    I'm not aware of any app that will translate the form fields from Word to the iPad. My guess is that you're going to have to recreate the forms on the iPad.  The best app that I've found for doing this is FormConnect http://http://itunes.apple.com/us/app/formconnect/id432653695?mt=8&ls=1. It's a very simple app for creating check boxes and text fields.

  • Tabbing through a form with multiple pages!!!!! FIX!!

    Hi everyone, I have a fix for this tricky issue of tabbing through a form that has multiple pages.
    1. You'll need to go to the "master page" and add as many pages as you have "body pages".
    2. Click the Object Veiw Tab and set the Occurence of the page to Max 1 and click the box with the instruction Include In Page Numbering.
    3. Do this for each page of the form that you have.
    4. The tabbing now should move from the 1st to 2nd to however many pages you have Master and Body Pages for.
    Glad I could figure this out! Goodluck!

    Thanks for the reply. Since my post to this topic I discovered some things about tabbing. With out adding another master page but just keeping the one and making sure that it's occurance is set to a minimum of one and including master page in the numbering it will work as long as the order of fields in the hierarchy tab matches the order in the position of the fields.
    I have a subForm that has a row of fields starting with a button then several text fields. I couldn't tab to the next page because the button was at the bottom of the hierarchy and it wasn't until I moved it to the top that I could finally tab to the next field on the next page. I also discovered that with a one page dynamic interactive form that has some expand able text fields in it and when the field expands so that any fields are pushed to a new second page tabbing seems to not work. In other words when I tab out of that field that is suppose to expand and a new page is added to the form the tabbing quits and in order for it to resume I have to click in a field and from then on it work even if it gets to where a third page and so forth is added. It is just when a one page (in my case) form turns into multiple pages for the first time.
    Hope that makes sense.

  • How do I fix tabbing through fields flow in order?

    In my form, I have mutliple text field boxes.  Sometimes, when I tab through the fields, one is skipped (not in sequence).  How do I fix that so the tabs flow in order?  For example, when I ask for:
    City:
    State:
    Zip:
    instead of going in order, the tab will go to:
    City:
    Zip:
    State:

    In the Heirarchy palette, if you change the Tab order No for one field, then rest of the form tab order wil lbe reset. This is a common functionality.
    When you go to View menu -> Show Tab Order, it will open up a splash screen with the simple instructions on setting the tab order.
    You can select the field in the Tab order palette on the left and drag it UP/ DOWN as needed to move it in the correct order.
    Thanks
    Srini

  • Need help: Tab through DataGrid

    I have developed an application in which, I m able to tab through the buttons,textboxes, drop down and the AdvancedDataGrid on the page. But I m unable to tab through the buttons and checkboxes inside the AdvancedDataGrid, which are rendered through itemRenderer. Please let me know whether is it possible or not.
    If yes,please provide me with a solution.

    It should just work if the renderers are buttons and checkboxes.  If you've wrapped them in containers you'll need to have the containers implement IFocusManagerComponent and delegate focus to the buttons.

  • Adding 2  Tabs through EEWB

    Hello All,
              I have an issue. Can you please tell me how to add 2 new tabs through the EEWB. I have already added 1 tab through EEWB. Now when I am trying to add 2 tab, the news fields get added in the 1 tab.
    Please provide me some solution for that.
    Regards
    Aashish Garg

    Hi,
    1. Create an entry for any standard tab in the screen flow in SPRO.
    There you have to assign a custom dev programm which calls the new dynpro
    2. Create the dynpro.
    In case of a dynpro with new tabel, just assign a single container on it.
    3. Create function modules for the dynpro.
    Assuming you have a ALV container on the new dynpro, create function modules which
    a) creates the ALV grid
    b) refreshes the ALV grid
    4. Create a custom dev Z Tables with required fields
    5. Assign Z Table field catalog to the ALV grid
    6. Handle data changes within the ALV
    7. Use
    a) CRM_INTLAY_GET_HEADER_GUID to receive the order information
    b) CRM_EVENT_PUBLISH_OW to raise a save event for CRMD_ORder
    c) CRM_ORDER_MAINTAIN to add something to the order (input fields are enough)
    d) CRM_1O_INSTANCE_GET_UI to set action flag
    --> all this will give CRMD_ORDER the information that data was changed (your new data)
    9. Create function modules which will give you your data from the ALV grid
    10. Use a BADI ORDER_SAVE to store your data on the database
    I know it is quite short, but it should give you a hint.
    Please give me reward points if you find it helpful.
    Thx
    Frank

Maybe you are looking for