Multiple keystrokes selection for a JComboBox in JTable

Has anyone used multiple keystrokes selection in a JComboBox inside JTable before? I can get it done outside JTable by using: http://javaalmanac.com/egs/javax.swing/combobox_CbMultiKey.html
Looks like JTable has all kinds of problems to support JComboBox.
Suggestions?
Thanks,
James

If I read you right, you want to use a multiple keystroke combo box as an editor in a JTable?
If you create the JComboBox as you would like it and then install it as an editor in the column(s) JTable the editor will work like the JComboBox
Example:
//- you would have that keyselection Manager class
// This key selection manager will handle selections based on multiple keys.
class MyKeySelectionManager implements JComboBox.KeySelectionManager {    ....    };
//- Create the JComboBox with the multiple keystroke ability
//- Create a read-only combobox
String[] items = {"Ant", "Ape", "Bat", "Boa", "Cat", "Cow"};
JComboBox cboBox = new JComboBox(items);
// Install the custom key selection manager
cboBox.setKeySelectionManager(new MyKeySelectionManager());
//- combo box editor for the JTable
DefaultCellEditor cboBoxCellEditor = new DefaultCellEditor(cboBox);
//- set the editor to the specified COlumn in the JTable - for example the first column (0)
tcm.getColumn(0).setCellEditor(cboBoxCellEditor); Finally, it may be necessary to to put a KeyPressed listener for the Tab key, and if you enter the column that has the JComboBox:
1) start the editting
table.editCellAt(row, col);2) get the editor component and cast it into a JComboBox (in this case)
Component comp = table.getEditorComponent();
JComboBox cboComp = (JComboBox) comp;3) give this compent the foucus to do its deed     
cboComp.requestFocus();Hope this helps!
dd

Similar Messages

  • F-44  ZBAPI MULTIPLE LINE SELECTIONS FOR WEB SERVICES

    HI TO ALL,
              I HAVE WRITTEN ZBAPI FOR POSTING MULTIPLE LINE SELECTIONS FOR TCODE F-44, THE ZBAPI  CONSIST OF BDC PROGRAM, WHICH IS WORKING IN SAP SYSTEM PERFECTLY BUT WHEN I AM USING IT IN WEB SERVICES IT IS THROWING A  ERROR MESSAGE.
                     PLEASE CAN ANY ONE TELL ME DOES THIS PROCESS WILL WORK OR NOT, IF YES HOW IS IT POSSIBLE

    Hi Gabriel,
    Let me try to answer some of your questions:
    1) The "Requires Secure Access" attribute of a resource handler controls whether this handler must be accessed/consumed only over SSL (HTTPS). Oracle Database Cloud Schema Service is only offered over SSL, so this attribute does not have any effect on RESTful services deployed in this environment (because secure access is always required and there is no other way). That said, if you want to access such web service from your own APEX instance, your instance must have Oracle Wallet configured with appropriate SSL certificate.
    2) The URI parameters are not required. If your web service returns data for many entities (for example, list of employees in employees/), you may not need a parameter. If your web service returns data for one specific entity (for example, details of one employee in employees/{id}), you may want to identify that entity with a URI parameter.
    3) You can have many URI parameters, for example: customers/{id}/orders/{order_id}.
    4) Yes, these are the same HTTP methods/verbs you would use from PHP.
    5) If you are trying this POST example from your own APEX instance (not Oracle Database Cloud Schema Service) and you are trying to access a web service over SSL, then it is likely that the Oracle Wallet used by your instance does not include the required SSL certificate(s), or the Oracle Wallet is not configured at all.
    6) I recommend to check RESTful Web Services for the Oracle Database Cloud white paper and Oracle REST Data Services Developers Guide. Oracle REST Data Services is the technology that enables RESTful services in the Oracle Database Cloud Schema Service.
    You can certainly create your own web services in the Oracle Database Cloud Schema Service and consume them from the same environment.
    Vlad

  • Multiple Range Selection for field Material in CS14

    Hi friends ,
    Is it possible to make multiple range selection for material field in tcode CS14 [used to compare primary and secondary BOM] i have made it ZCS14.
    if i make matnr2 to matnr2-low
    but my doubt is it feasible solution
    please through some light on this
    regards
    soorya

    Dear Soorya,
    What's your requirement? is that to compare the Alternative BOM's for multiple materials at the same time?
    If it's going to be for comparing one more alternative for the same material,then it's a good report.
    As per to my knowledge if the report is going to be for a list of materials Alternative BOM's means I dont
    think whether it will be a fast(time wise) report.
    Check & revert back.
    Regards
    Mangalraj.S

  • Multiple line selection for RRI  in WAD

    Is it possible to select multiple lines from 1 query and do a RRI to the receiver query. Eg : Select multiple POs and then go to PO details query which shows PO details of multiple POs in WAD and both the results shown in the same web report?
    I tried the below solution, but all I get is the display of the entire Master data dump and not the filtered values. Any suggestion?????
    Rao  
    Posts: 135
    Registered: 6/24/04
    Forum Points: 8 
       Re: Multiple line selection for RRI   
    Posted: Feb 4, 2008 2:22 PM    in response to: LAKSHMI HARINDRAN           Reply 
    Yes. You can do this. You create web template with ANALYSIS web item. In the item parameters of ANALYSIS web item, you can set a property, single line or multiple for the runtime selection. Once you do this, you create a button option or context selection menu option to jump target. In the button (RRI button) in the command sequence, the first command should be SET_SELECTION_STATE_BY_BINDING and then, the RRI command to jump to the target. Hope it will help.
    Venny.

    Hi, Do you have any solution on this. please suggest. Thanks

  • Event Handler for a JComboBox in JTable

    Hi,
    I am using a JTable with one column having JComboBox as CellEditor, I Want to handle event for jcomboBox such that if I am selecting any item from JcomboBox item , i check if there is any field before that in the Jtable Cell if yes then I am setting it to null or the previous value. I have implemented CellEditorListener to it but it is not working fine, so if anyone can please help me out..

    If I read you right, you want to use a multiple keystroke combo box as an editor in a JTable?
    If you create the JComboBox as you would like it and then install it as an editor in the column(s) JTable the editor will work like the JComboBox
    Example:
    //- you would have that keyselection Manager class
    // This key selection manager will handle selections based on multiple keys.
    class MyKeySelectionManager implements JComboBox.KeySelectionManager {    ....    };
    //- Create the JComboBox with the multiple keystroke ability
    //- Create a read-only combobox
    String[] items = {"Ant", "Ape", "Bat", "Boa", "Cat", "Cow"};
    JComboBox cboBox = new JComboBox(items);
    // Install the custom key selection manager
    cboBox.setKeySelectionManager(new MyKeySelectionManager());
    //- combo box editor for the JTable
    DefaultCellEditor cboBoxCellEditor = new DefaultCellEditor(cboBox);
    //- set the editor to the specified COlumn in the JTable - for example the first column (0)
    tcm.getColumn(0).setCellEditor(cboBoxCellEditor); Finally, it may be necessary to to put a KeyPressed listener for the Tab key, and if you enter the column that has the JComboBox:
    1) start the editting
    table.editCellAt(row, col);2) get the editor component and cast it into a JComboBox (in this case)
    Component comp = table.getEditorComponent();
    JComboBox cboComp = (JComboBox) comp;3) give this compent the foucus to do its deed     
    cboComp.requestFocus();Hope this helps!
    dd

  • Multiple row select for table not working..

    Hi Experts,
    I have a table in ABAP Web Dynpro where I have enabled the multiple row select functionality. I can select all and deselect all. I can also select a block of adjacent rows of table by choosing first and last by pressing Shift key.
    But I am not able to select multiple individual records for that table.
    I tried the same thing in different system and it works fine there.
    Please let me know if we are missing some standard plugin or we need to enable this in some settings.
    System where the issue is:
    SAP_APPL: release 600, level 18
    SAP_BASIS: Release 700, level 22
    System where it is working fine:
    SAP_APPL: release 604, level 8
    SAP_BASIS: release 701, level 8
    Regards,
    Anand Kolte

    Hi
    Press CTRL key and Select records, you can select multiple records, continuously or randomly your desired selection.
    Cheers,
    Kris.

  • In prod order multiple batch selection for my raw material /sf possible

    Dear All,
    One of problem I am facing is regarding multiple batch selection .
    Scenario is like this
    Finished prdt _ FMBLD003         
    RAW matl  -      2RCH001
    In prodn order my BOM requirement quantity for 2RCH001 IS 75 kg , I have material available in stock in  three diffrent batches
    0000111   40 kg
    0000112   15 kg
    0000113   30 kg  
    I can select any one batch at a time. Is there any option or possibility available wherein we can select multiple batches .
    or Is there possibility that system should automatically split bom quantity as per the batch quantity available shown below
    40       0000111
    15       0000112
    20       0000113
    I tried but didnt found possible solution.
    Please suggest .
    Edited by: sapitheprabhu on May 3, 2011 7:28 AM
    Edited by: sapitheprabhu on May 3, 2011 7:48 AM

    Dear Prabhu,
    When do batch determination you maintain req qty against to batch number in batch determination co: select batch.
    0000111   40 kg
    0000112   15 kg
    0000113   30 kg
    Jainashu

  • Multiple row selection for table element

    Hi,
    I have a requirement where I require to select multiple rows from a table element in a WD for abap application.
    I have defined a node with cardinality and selection set to 1..n.
    The contex node contains 4 fields : emp_name, pernr, manager and position.
    The attributes of the table element for selectionmode is set to 'multi' and 'selectionchangebehaviour' is set to 'auto'.
    I have defined an action on the 'onleadselection' event.
    The code in this method also includes the statement 'lo_el_team_view->set_selected( EXPORTING flag = abap_true ).' 
    When I execute the application only 1 row is highlighted at any one time when I select it. You can select multiple rows by holding down the 'ctrl' key but I want to avoid having to do this. Is there anything I have missed out causing multiple row selections not to be all highlighted.
    Thanks in advance for any assistance.

    Hi raj,
    you can try the following code in the 'onleadselect' event of the table,
    create one attribute ' Flag'  of type WDY_BOOLEAN under the node which has been binded to the table.
    DATA lo_nd_node_tab1 TYPE REF TO if_wd_context_node.
      DATA lo_el_node_tab1 TYPE REF TO if_wd_context_element.
      DATA  lo_elements TYPE wdr_context_element_set.
      DATA  lo_ele_select_new TYPE REF TO if_wd_context_element.
      DATA lv_deselect TYPE wdy_boolean.
      DATA lv_flag TYPE wdy_boolean.
      DATA lv_select TYPE wdy_boolean.
      DATA lv_index TYPE i VALUE 0.
      lo_nd_node_tab1 = wd_context->get_child_node( name = wd_this->wdctx_node_tab1 ).
    get the current selected element
      lo_ele_select_new = wdevent->get_context_element( name = 'NEW_ROW_ELEMENT' ).
      CHECK lo_ele_select_new IS NOT INITIAL.
    check whether it has been selected or not
      CALL METHOD lo_ele_select_new->is_selected
        RECEIVING
          flag = lv_select.
      lo_ele_select_new->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_deselect ).
    check whether element has been previously selected or not,if not, set the flag to select it
    IF lv_select IS NOT INITIAL AND lv_deselect IS INITIAL.
        lo_ele_select_new->set_attribute( name = 'FLAG' value = 'X' ).
    if selected currently and previously then set the flag as false,in order to delect it
      ELSEIF lv_select IS NOT INITIAL AND lv_deselect IS NOT INITIAL..
        lo_ele_select_new->set_attribute( name = 'FLAG' value = ' ' ).
      ENDIF.
      CALL METHOD lo_nd_node_tab1->get_elements
        RECEIVING
          set = lo_elements.
    according to the falg, select and delect the elements
    LOOP AT lo_elements INTO lo_el_node_tab1.
        lo_el_node_tab1->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_flag ).
        IF lv_flag = 'X'.
          lo_el_node_tab1->set_selected( abap_true ).
          lo_nd_node_tab1->set_lead_selection_index( lv_index ).  * this statement deselects the lead selection index*
        ELSE.
          lo_el_node_tab1->set_selected( abap_false ).
          lo_nd_node_tab1->set_lead_selection_index( lv_index ).
        ENDIF.
      ENDLOOP.
    I hope this resolves your problem.
    Thanks,
    krishna

  • Setting a default selection for a JComboBox

    Hi
    I am using a JComboBox how can I create a default selection for the combobox. If the user does not make any selection from the combo box I want them to use a default.
    --kirk123

    How about comboBox.setSelectedIndex(0) ? That will set the default selected.

  • Disable row selection for certain column in JTable

    I have a JTable with several columns, one of which contains an "Info" button. I already have it worked out that when I click on the "Info" button, that event gets passed from the JTable to the button. I have multi-select enabled for the JTable, but I don't want clicking on the "Info" button to change the current selection. I have a klugy "fix" working where I save off the current selection, and then restore it after the user presses the "Info" button. However, this results in "flashing" - the row containing the selected "Info" button becomes selected briefly, then the original selection is restored. How can I avoid this? I would like to just ignore selection events on the "Info" column, but still pass the mouse click event through to the button.
    Any suggestions?

    try this
            JTable table = new JTable() {
                public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend) {
                    if (!getColumnModel().getColumn(columnIndex).getIdentifier().equals("Info")) {
                        super.changeSelection(rowIndex, columnIndex, toggle, extend);
                    }//else

  • Multiple line selection for RRI

    Is it possible to select multiple lines  from 1 query and do a RRI to the receiver query. Eg : Select multiple POs and then go to PO details query which shows PO details of multiple POs.
    Also when you do a RRI from 1 q to other , does the filter criteria of 2nd query pop up to the user ?
    thanks in advance ,
    LH

    Hi Lakshmi,
    Yes, it is possible to select multiple lines from one query. It means as you said, if you select multiple PO's i.e., Po's belong to a customer. If 10 PO's belong to single customer, then if you select that customer and Goto RRI in the report, you will get the details of all those 10 PO's in the RRI report. This is done in RSBBS tcode>After creating RRI>Assignment details-->Map the required fields of sender to the reciever queries according to the need.
    When you use RRI, the reciver query, i.e., the second query will contain the filter selection as usual in the normal report when executed.
    Hope this helps u...
    Regards,
    KK.

  • Multiple Images - selection for pre loading

    The preload image behaviour supplied within Dreamweaver is fine up to a point, but it inserts javascript files and is a pain to use if, for instance, you have 20 or so images to load. Or maybe I'm just lazy!
    It is possible to preload images using CSS2 (see http://www.thecssninja.com/css/even-better-image-preloading-with-css2 ) and in CSS3 (see http://perishablepress.com/press/2010/01/04/preload-images-css3/ )
    But none of these give you the option to browse to a folder, select a group of images from it and paste the results into the  the code.
    Has anyone found an extension that will do this?

    >>What seems to be happening the first time is the
    image isn't loaded before
    >>the fade is finished, so the image just appears after
    a short pause the
    >>first time.
    As has been said many times in thos forum - use the
    MovieClipLoader class to
    load images, and then use that class' onLoadInit method to do
    things with
    the loaded image. Loading is asynchronous - you _have_ to
    wait until the
    image is done loading before doing a fade.
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • TDMS Maintain Table deduction: Multiple table selection for "No Transfer"

    Dear TDMS Experts,
    Please provide the solution for the below 2 points.
    TDMS SYSTEM LANDSCAPE DETAILS: DMIS 3.0 SP17, DMIS_EXT SP17 & DMIS_CNT SP10
    Control System: client 200, Sender: client 125 (with prod data), Receiver: Client 300 (copy of SAP_UCSV). All 3 clients in same server.
    Installed TDMS and all the configurations completed with Package setting phase successful.
    1. In System Analysis phase - Maintain Table Deduction, I want to exclude thousands of tables as "no transfer" where I found option to change  " no transfer" for individual table . For Testing purpose I would like to transfer only few tables where i do not required all the default selected "transfer" tables.
    2. In Data trasfer phase - Start Deletion of data in Receiver system: This process running for a long time  by scheduling jobs for each and every tables in receiver system, Is there is any option to avoid data deletion in receiver system or minimise the scheduled jobs.
    Thanks
    Chidam

    In normal scenario, TDMS transfer data from sender to receiver without changing it.Data scrambling is additional feature where you can write your own rules for data transfer for sensitive data tables. These rules are called 'scrambling rules.
    sensitive data (like customersu2019 personal data or confidential financial information) is made anonymous and is not accessible to users of the non-production system. Scrambling rules may be either field-related (referring to a single field) or event-related (referring to two or more fields which are related). For field-related rules, assignment at domain level or at field level is possible.
    TDMS doesnot delivers any scrambling rules. It provides you the platform where your developers can write their own rule.
    The rules are only applicable for transparent fields.
    You will find more detailed information in master guide and the process in TDMS operation guide. Both are available at marketplace.
    - Niraj

  • Multiple answer selection for Captivate 7 Dropdown menu widget

    Hi folks,
    Is there a way where I can have my users select more than item in the dropdown menu?
    Thanks
    Ivan

    OMG, it is my frustration day, really. All widgets are still coming with Captivate 7, only they are bit hidden for some obscure reason???
    Use the Widget workspace, that is still available. In the Widget panel you'll have normally the widgets. Because if you choose Insert Widget (this also disappeared from the vertical toolbox) you'll not see the widgets but the interactions, the path is not correct. If you do not see the widgets in the Widget panel, you'll have to browse (there is a small icon at the bottom) to Gallery\Widgets in the installation folder of Captivate.
    Lilybiri

  • KeyBindings: Multiple key selections for actionPerformed in one methdo

    I'm making a program where I have several objects that respond differently when different buttons are pressed. I'd like to use key bindings without using anonymous or inner classes as per my preference (I think the code is cleaner and easier to read and understand), so I'd like to find a way to determine which key was pressed in which object. I have an SSCCE here with some psueudocode that is an attempt to explain what I'm trying to do.
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import javax.swing.KeyStroke;
    import javax.swing.WindowConstants;
    public class SSCCE extends AbstractAction
         private JPanel p = new JPanel();
         private JTextField t[] = {new JTextField(10),new JTextField(10)};
         public SSCCE()
              JFrame f = new JFrame("SSCCE");
              p.add(t[0]);
              p.add(t[1]);
              p.getActionMap().put(p.getInputMap().get(KeyStroke.getKeyStroke("F1")), this);
              p.getActionMap().put(p.getInputMap().get(KeyStroke.getKeyStroke("F2")), this);
              p.getActionMap().put(p.getInputMap().get(KeyStroke.getKeyStroke("F3")), this);
              f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              f.setSize(300,100);
              f.setLocationRelativeTo(null);
              f.add(p);
              f.setVisible(true);
         @Override
         public void actionPerformed(ActionEvent arg0)
              /*if (t[0] has focus when event is fired)
               *     if(F1 is pressed)
               *          //do some code
               *     else if(F2 is pressed)
               *          //do other code
               *     else
               *          //do some code
               *else if(t[1] has focus when event is fired)
               *     if(F1 is pressed)
               *          //do some code
               *     else if(F2 is pressed)
               *          //do some code
               *     else
               *          //do some code
         public static void main(String[] args)
              new SSCCE();
    }

    How? I just tried that, but it didn't work.
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import javax.swing.KeyStroke;
    import javax.swing.WindowConstants;
    public class SSCCE
         private JPanel p = new JPanel();
         private JTextField t[] = {new JTextField(10),new JTextField(10)};
         public SSCCE()
              JFrame f = new JFrame("SSCCE");
              p.add(t[0]);
              p.add(t[1]);
              t[0].getActionMap().put(t[0].getInputMap().get(KeyStroke.getKeyStroke("F1")), new t0F1());
              t[0].getActionMap().put(t[0].getInputMap().get(KeyStroke.getKeyStroke("F2")), new t0F2());
              t[1].getActionMap().put(t[1].getInputMap().get(KeyStroke.getKeyStroke("F1")), new t1F1());
              t[1].getActionMap().put(t[1].getInputMap().get(KeyStroke.getKeyStroke("F2")), new t1F2());
              f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              f.setSize(300,100);
              f.setLocationRelativeTo(null);
              f.add(p);
              f.setVisible(true);
         public static void main(String[] args)
              new SSCCE();
         public class t0F1 extends AbstractAction
              @Override
              public void actionPerformed(ActionEvent e)
                   System.out.println(e.getSource());
         public class t0F2 extends AbstractAction
              @Override
              public void actionPerformed(ActionEvent e)
                   System.out.println(e.getSource());
         public class t1F1 extends AbstractAction
              @Override
              public void actionPerformed(ActionEvent e)
                   System.out.println(e.getSource());
         public class t1F2 extends AbstractAction
              @Override
              public void actionPerformed(ActionEvent e)
                   System.out.println(e.getSource());
    }

Maybe you are looking for