JTable modify row order

Hi,All
I have a JTable object, and want to reorder row.
how to implement this function?
for example:
FirstRow 1 2
SecondRow 1 2
I want to reorder row to:
secondRow 1 2
FirstRow 1 2
Thanks in advanced

DefaultTableModel.removeRow(...);
DefaultTableModel.insertRow(...);
Or maybe you are asking about sorting rows in a table, in which case you should read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#sorting]How to Use Tables.

Similar Messages

  • JTable Blank Rows When INSERT/DELETE in other panel with same ViewObject

    Hi,
    Jdev 10.1.2
    JClient
    2 panels based on same ViewObject in same AM
    One panel with Grid UI => JTable
    Other panel with Form UI
    When I insert or delete a record in the panel with Form UI and return to the panel with JTable blank rows are displayed.
    The problem remains even after commiting before returning to JTable panel.
    When I activate the execute button in the JTable panel, the display is OK but the currency is lost.
    I suppose calling the refresh method when returning to the JTable panel should solve the problem.
    Can you please suggest me a server-side/model workaround:
    refresh (which option to use ??)
    Thanks
    Frederic
    PS I tried the workaround of thread 10.1.2 JClient binding Error. but that doesn't help.

    Same problem with default wizard generated Master-Detail Form.
    When in the detail more then 10 rows exist, the scrollbar shows that not all rows are displayed.
    If I use the scrollbar to view the last rows they are blank, in order to display them I must activate the next button one time for each additional row.
    The workaround is to enter -1 in the range size of the iterator.
    But what if the range size is 10.
    Is the blank rows display a bug?
    OR
    Must the scrolling area (size of JScrollPane) be defined according to the range size of the iterator?
    If the latter is true:
    Can somebody give me some clues on which attributes of the JScrollPane must be set (PreferredSize, MinimumSize ??) and on how to calculate this area: total width & total height if the row height for the table is set to 20?
    Your help will be appreciated
    Frederic

  • JTable, select row on right mouse click

    Hi,
    If I right click on a jTable row in my application, the row I click on does not get selected.
    How can I modify the mouse listener attached to the jtable to deal with this?
    jtable.addMouseListener( { e->
    if (e.isPopupTrigger())
        swing.popupMenu(menuItems).show(e.getComponent(), e.getX(), e.getY());
    } as java.awt.event.MouseListener)Thanks!

    Problem solved!
    jtable.addMouseListener( { e->
    if (e.isPopupTrigger()){
        int row = jtable.rowAtPoint( e.getPoint() );
        jtable.changeSelection( row, 0, false, false );
        swing.popupMenu(menuItems).show(e.getComponent(), e.getX(), e.getY());
    } as java.awt.event.MouseListener)

  • Excel - Modify rows without touching other data (have gone thru LV report generation 4 designs)

    File attached....
    Have gone thru FAQs and examples. (And also 4 parts of 'Creating a Report in Microsoft Excel Using the LabVIEW Report Generation Toolkit'. Unfortunately this document is not clear enough for me.)
    Have task of modifying rows of the same excel sheet, number of times without touching data  already present (numbers and strings)
    I have an excel file. (attached)
    A test will be run N number of times.  (N<=17)
    SubTask 1 --> Each time it runs, string data needs to be placed in 'n'th row. (...there are going to be notes in Row 18 and row 19)
    SubTask 2  --> Each time it runs, a 1D array data also will be placed in the same row (but in different cells)
    SubTask 3 --> The number 'n' of the row (where to place the current iteration's data) needs to be determined on fly (by looking at "n-1"st non blank row)
    The same file needs to be used.
    How can above be achieved ?
    thnks
    Sandeep
    Attachments:
    sample excel file.xls ‏14 KB

    See if this board will help.
    http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=2391

  • Modify Sales order Item additional tab B

    I need to modify Sales order item additional tab B ...by removing the exisitng fields and should add some new fields ....which is ok. But does it have any impact becoz the same screen fields coulbe used in any of the other transaction .......i  just wanted to know if we remove the fields from sale orde item additional tab B and some new details will have some impact

    Hi,
    Before making any modifications check "Where-used". If it is in some other program other than the VA01/02/03, then better consult your lead before modifying.
    If you do not find, go ahead and make the changes confidently.
    Regards,
    Subramanian

  • Need to modify Sales order Item additional tab B

    Hello all,
    I need to modify Sales order item additional tab B ...by removing the exisitng fields and should add some new fields ....does it have any impact on this screen could be used in any of the other transaction .......i  just wanted if we remove the fields and some new details will have some impact
    Regards,
    KK

    Additional data B is used to add your own fields also known as custom fields in sales order.
    Custom fields can be added to tables VBAK & VBAP (depending on header or item). Similarly you can remove fields if you don't require it anymore.
    In short, your requirement can be met but you have to take help of ABAP consultant since it requires maintenance of user exits and modification of screens.

  • How to save the modified rows in jspx page usind adf default commit action

    Hi,
    We are displaying some columns of the database table in jspx page. Here we are using adf commit action to save these values to database which is updating all the rows by default. In this page there are some editable columns which the user can miodify. How can we update only these modified rows using default adf commit action. Also we want to update last_updated_date column of that particular row which is modified in the UI from backing bean .
    Can anyone please help us in solving this.
    Thanks in advance

    User,
    A key question - what are you using for the model layer (ADF Business Components, JPA, EJB, etc)?
    How are you determining that a "commit" action is updating rows (even those which haven't changed)?
    If you are using ADF Business Components - have a read in the documentation about history columns - the use case you describe (updating the last_udpdated_date column) is supported "out-of-the-box" for this.
    John

  • Checkbox and Buttons in a JTable's row

    Hi,
    how do i put an Checkbox or a Button in a JTable row? When i try to insert any element to a JTable's row it automatically converts it to string. How can i solve this?
    Many thanks,
    Nuno Almeida

    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • How to set color of our specified JTable's row

    i need to set color of our specified JTable's row.so send the coddings of that part.

    i need to set color of our specified JTable's row.so
    send the coddings of that part.I think you misunderstand how this forum works...
    If you have a problem, you post your problem here with example code which demonstrates said problem...
    The people here then attempt to help you if they want to.
    You do not post demands for code examples

  • Modify purchase order to include company logo

    Hi,
           How to Modify purchase order to include company logo

    Modfying is  nothing but copying the existing form to new name.
    For example MEDRUCK  is standard one .
    Copy this to new one as follows.
    1.In SE71 Utilities -> Copy from Client
    2. Mandatory fields
    Form Name:MEDRUCk
    Source Client:Depends upon ur client
    TArget form:ZMEDRUCK
    Check both the check boxes there
    3 .Click Save button
    4.New form will be created
    5.Now do ur changes.
    Niow u have to add the program and the modified form in the NACE to an output type.
    Next using the new out put type, in the transaction mee2n give a po number.
    Next in the tool bar u have Goto -> Messages
    In that screen u have to give the new out put type and medium and partner.
    Once this is done u can save and go back check the print preview.
    Follow the above steps and let me know if u face any problem,
    Regards
    Ravi

  • How to highlight a modified row in module pool

    hi frnds,
         Is it possible to highlight a row that is modified in a  ztable using module pool...

    I have created a ztable-'zpk_table' from which i take the values  n pass it to an internal table-'itab'...
    i modify these values using a modify screen created in module pool..
    after modifying i want the modified row to be highlighted in the next table control screen...

  • Listen double clicks on JTable's row

    hi,
    I want to know how to catch double clicks did on a specific JTable's row, or any cell on that.
    I know that's possible because JTable is a JComponent..so, I want to know how to catch the event when the user press Enter over a single selected row, too...
    If you may show me and example or specific links, I'll thank you so much..
    lucky..

    b) The Enter key is used to move the row selection to
    the next row so you need to override the default
    mappings of the table.
    This posting shows how you would do the above on a
    JList. The code should be similiar for a JTable.
    http://forum.java.sun.com/thread.jspa?forumID=57&threa
    dID=626866Thanks anyway...I fix that with a tricky and simplest solution.
    I only put a KeyEventListener on the table and catch the keyEvent, and if it's a EnterKey, then check wich row is selected on table.
    table.addkeyListener(new KeyListener(){
                public void keyPressed(KeyEvent e) {
                    if(e.getKeyCode()==KeyEvent.VK_ENTER){
                        int[] selected_rows = table.getSelectedRows();
                        if(selected_rows.length==1){
                            int row = selected_rows[0];
                            DefaultTableModel table_model = (DefaultTableModel)table.getModel();
                            Object element_at_row = directory_model.getValueAt(row, 1); //I wanna Only the element at column 1
                             //do more things...                      
    //....other interface's methods..
    );

  • Can we modify sales order line item before its booked through API?

    can we modify sales order line item before its booked through process_order API?
    here we have a situation where related item should be substituted for actual order item when user selects the related item , So looking for a way to modify the ordered item on sales order line .
    Thanks,

    Hi
    There is an API to update the Related Item on the line level in the Sales Order.
    PROCESS_ORDER API can be used for this purpose. It is part of OE_ORDER_PUB.
    Below are the fields on line table type that will be assigned to create an order line with related item and original ordered item.
    ORIGINAL_ORDERED_ITEM : Original Item
    ORDERED_ITEM : Related Item
    ITEM_RELATIONSHIP_TYPE : Type of Relationship.
    Please go ahead and try to create it like this. I am pretty sure that it will get the order created with related items.
    Note: Please make sure the profile option
    OM: Enable Related Items
    should be enabled.
    Please mark the response as helpful or correct if it provides you the solution.
    Thanks
    Mirza Tanzeel

  • User exit to modify sales order pricing condition

    Hi Experts,
    I need ot modify Sales Order Header Condition (ZFRH), Condition Value (KWERT) for Transaction VA01 & VA02
    I agree there are many user exits which will modify XKOMV-KWERT structure and can populate what ever value we insert.
    But the value we insert is inserting into line item condition and the total of all line items is populating in Header .
    I need to modify only Header condition without populating Line items
    Thanks ,
    Basheer .

    Hi:
    Program : MV45AFZZ
    search for USEREXIT_NUMBER_RANGE.
    BR,
    Manthana

  • Modify Rows in Cursor

    How can i Modify rows in a Cursor?
    i want to loop through cursor records and update rows on sepcific condition and update one field .and put back in the cursor.
    Suggest Some way to achieve this.

    you can only modify values of rows within the cursor when the values in the cursor are fetched and then looped through.
    Once the fetch is over and you modify some values the values are not permenant. If you open the cursor again then old values will be fetched.
    eg:
    SQL> DECLARE
      2     CURSOR c1
      3     IS
      4        SELECT 1 AS col1, 2 AS col2
      5          FROM DUAL
      6        UNION ALL
      7        SELECT 3 AS col1, 4 AS col2
      8          FROM DUAL;
      9  BEGIN
    10     FOR i IN c1
    11     LOOP
    12        DBMS_OUTPUT.put_line ('col1--->'||i.col1);
    13        i.col1 := 10;
    14        i.col2 := 20;
    15        DBMS_OUTPUT.put_line ('col1--->'||i.col1);
    16        DBMS_OUTPUT.put_line ('col2--->'||i.col2);
    17     END LOOP;
    18  END;
    19  /
    col1--->1
    col1--->10
    col2--->20
    col1--->3
    col1--->10
    col2--->20here col1 value is modified and if you are doing further processing inside the loop for that record then 10 will avaliable and not 1. But if i again open the cursor and loop through 1 will be the value.
    Hope it makes sense...
    Edited by: [email protected] on May 11, 2010 5:29 AM

Maybe you are looking for