Finding and selecting rows JTable

Hey all!
Im having a bit of trouble with my JTable, I have a JInternalFrame which holds a JTable and a "Find" button, once you press the Find button a seperate JFrame pops up and searches the JTable for the information entered, but it just gives a JOptionPane saying that it was found at row 'n'
What i want instead of the JOptionPane is for the JFrame to stay open (so you can Find Next) and for the row that has the information to be highlighted/selected
Any ideas on this would be great,
Thanks in advance

write for a class `search` with constructor
search(myTable tab)
onClick event of the button pass table object to the search constructor
public void actionPerformed(ActionEvent e)
search s=new search(mainTable);//<--Your table object
}now whatever you do for that object you can handle the main
table object.
use this to select cell
table.changeSelection(row,col,false,false);
In class search add passed table in the frame

Similar Messages

  • Finding and selecting (ticking) items in one shot in ZSDE_DNP - SAP SD

    Hi all,
    i am new here,
    looking for your supports,
    i have a small issue in the SAP SD module in the ZSDE_DNP screen.
    i want to select only 10 items randomly from around 100 items to process the delivery note, for this i have to first find that item using Ctrl + F and then select (Tick) it.
    is there any thing that i can minimize my steps of finding and selecting particular items in ZSDE_DNP screen.

    Welcome to the forum.  As a new member, I would like to inform you that there are certain rules and regulations applicable to this forum which you can find to your right screen. 
    Coming to your query, the transaction code indicated by you is not a standard one but a customized one.  Hence, please check with your ABAPer on the possibility of what you are expecting.
    G. Lakshmipathi

  • When I open the vi, Labview asks to find and select the same vi.

    This one is a little strange......
    As I was attempting to edit the block diagram of my program, that had just completed running with no errors, Labview (and Windows) locked up and I had to do a hard reset of the computer.  After rebooting and doubleclicking the main vi icon, Labview did the usual loading of all the dll's and other vi's and then it asked me to find and select the main program vi.  When I select it, it asks again and again.  If I ignore it Labview goes back to it's splash screen.  The program doesn't load at all.
    I'm sure having to reset the computer without shutting it down did this, but is there no way to open the file now at all?  I have a feeling that I'm going to be stuck having to reprogram everything again.
    Thanks,
    Tony

    First rule: always backup!
    Now, try some other things, instead of double clicking.
    For example, try placing your main VI as a subVI inside an empty VI or try calling it dynamically or opening all of its subVIs before opening it (although from your description I don't see why these should work). The other option is contacting NI and see if they can salvage your VI.
    Try to take over the world!

  • ALV event ON_CLICK - find out selected row?

    I have an ALV table and in one of the columns I display a linkToAction in each cell.
    When the link is clicked, i go to the ON_CLICK event handler and try to find out, which row is selected.
    For this, I can take the attribute "INDEX" of the parameter "R_PARAM", and read the context with the given index.
    METHOD alv_event_on_click .
       DATA lo_nd_my_node    TYPE REF TO if_wd_context_node.
       DATA lt_my_table          TYPE wd_this->elements_my_table.
       DATA ls_my_structure    TYPE wd_this->element_my_struture.
    *  click on prduct standard name link
       IF r_param->attribute = 'NAME_OF_THE_COLUMN'.
           lo_nd_my_node = wd_context->get_child_node( name = wd_this->wdctx_my_node ).
           lo_nd_my_node->get_static_attributes_table( IMPORTING table = lt_my_table ). "this is not sorted!!!!
           lo_nd_my_node->set_lead_selection_index( index = r_param->index ).
           READ TABLE lt_my_table INTO ls_my_structure INDEX r_param->index. "lt_my_table table might be sorted differently!!!!
           IF sy-subrc = 0.
             wd_this->do_something_with( ls_my_strcture ).
           ENDIF.
       ENDIF.
    ENDMETHOD.
    However, this does not work when I sort the ALV before!
    For a strange reason, the table that I get from the context is not sorted the same way as the data in the ALV.
    What can I do?

    Hi Daniel,
    I don't know if the external mapping messes things up.
    Perhaps you could try the following:
    lo_nd_my_node->get_static_attributes(
      EXPORTING
        index                = r_param->index
      IMPORTING
        static_attributes = ls_my_structure ).
    It could be that passing the data towards your internal table doesn't take over the sort.
    If you try debugging and check out the contents of the node, are they sorted correctly or not?
    Regards and good luck.
    Jos

  • How to read 'clicked header' AND selected row from multicolumn listbox?

    I have a multicolumn listbox filled with 6 columns and about 500 rows.
    I want the user to be able to click on a column header, and sort the listbox alphabetically on that column. I've written the code for that, and that works. (using the 'itemnames' en 'get clicked col hdr' properties.)
    However, I also want to include the option, that when a user highlights a row, and then clicks on the header, that after the listbox gets sorted it scrolls down to the selected row.
    (So that the user doesn't have to search for it)
    And that's where things go wrong, because the value of the listbox changes to zero when you click on a column header. No I idea why it does that, but it's rather
    annoying. Can I change that behaviour somehow?
    Or any ideas how to get around it?

    My thanks to you and Jared.
    Seems I got a working solution now.
    Did take a while to figure out why your solution worked. Basicly, you're reading the row from a few iterations before.
    As soon as I understood that, I simplified it a little. Look at the attached file... I think it does the same. :-)
    Jared asked for the sorting routine. As I don't seem to be able to attach files when replying to comments, I took the liberty to include it here also.
    Basicly, I just use the 'sort 1D array' that comes with Labview 6. To be able to sort a 2D array, I convert every row to a cluster. That's something the 'sort 1D array' VI can handle nicely.
    To sort on the correct column, I just cut all columns in front, and paste them behind again. A
    fter sorting, I reverse the process.
    Anthony.
    Attachments:
    copy2_of_multicolumn.vi ‏26 KB
    sort_2d_string_array.vi ‏34 KB

  • JTable and selected row

    Hi,
    I'm new to Java, I'm writing a simple application using Swing, I've almost finished, almost, becose I have a jTabbedPane on 1st pane some labels and text fields, and on the second one jTable, I have to do 2 things:
    When row in JTable is selected, then the same user data should bevisible in JTabbedPane/Panel1 and if I select someon in panel1 then also the person in the jTable should be selected, what should I do? What's the function name? Please help.

    http://java.sun.com/docs/books/tutorial/uiswing/events/eventsandcomponents.html

  • Refresh adf table and selection row

    Hi,
    I create web application. I have created entity Users from MySQL database and managed Bean. In this managed Bean (sessionScope) is method for connection to database and method for adding new row (data) in database. It works.
    I have 2 problems.
    The first.
    I have form for adding User and commandButton Add.
    How I can refresh (update) adf table after executing SQL command (in commandButton Add) ? Now I must reconnect session.
    The second problem:
    I want to show a panel with data from one row from adf table.
    How I can selection this row in popup ?
    My table:
    <af:table var="user" rowBandingInterval="0" id="t2"
                                                  inlineStyle="margin:20px 30px; width:578pt; height:160pt;"
                                                  value="#{userController.users}"
                                                  rows="15"
                                                  emptyText="#{bindings.UsersprototypView11.viewable ? 'No data to display.' : 'Access Denied.'}"
                                                  fetchSize="#{bindings.UsersprototypView11.rangeSize}"
                                                  editingMode="clickToEdit" rowSelection="single"
                                                  selectedRowKeys="#{userController.selectedUser}"
                                                  selectionListener="#{userController.selectedUser}"> ---- Here I have problem.
                                            <af:column sortProperty="#{user.user_id}"
                                                       sortable="false"
                                                       headerText="ID"                            
                                                       id="c11" width="33">
                                                <af:commandLink id="ot34" text="#{user.user_id}">
                                                    <af:showPopupBehavior popupId="p4" triggerType="action"/>
                                                </af:commandLink>
                                            </af:column>
                                            <af:column sortProperty="#{user.firstname}"
                                                       sortable="false"
                                                       headerText="Firstname"
                                                       id="c20" width="111">
                                                <af:outputText value="#{user.firstname}" id="ot27"/>
                                            </af:column>
                                            <af:column sortProperty="#{user.lastname}"
                                                       sortable="false"
                                                       headerText="Lastname"
                                                       id="c12">
                                                <af:outputText value="#{user.lastname}" id="ot31"/>
                                            </af:column>
                                            <af:column sortProperty="#{user.address}"
                                                       sortable="false"
                                                       headerText="Address"
                                                       id="c9" width="95">
                                                <af:outputText value="#{user.address}" id="ot32"/>
                                            </af:column>
                                            <af:column sortProperty="#{user.city}"
                                                       sortable="false"
                                                       headerText="#City"
                                                       id="c10" width="76">
                                                <af:outputText value="#{user.city}" id="ot33"/>
                                            </af:column>
                                            <af:column sortProperty="#{user.username}"
                                                       sortable="false"
                                                       headerText="Username"
                                                       id="c7" width="102">
                                                <af:outputText value="#{user.username}" id="ot29"/>
                                            </af:column>
                                            <af:column sortProperty="#{user.email}"
                                                       sortable="false"
                                                       headerText="E-mail"
                                                       id="c21" width="106">
                                                <af:outputText value="#{user.email}" id="ot28"/>
                                            </af:column>
                                            <af:column sortProperty="#{user.regdate}"
                                                       sortable="false"
                                                       headerText="Registration"
                                                       id="c8" width="108">
                                                <af:outputText value="#{user.regdate}" id="ot30">
                                                    <af:convertDateTime pattern="#{user.regdate}"/>
                                                </af:outputText>
                                            </af:column>
                                        </af:table>userController is name managed Bean.
    users is list of users.
    My panel window (popup):
    <af:popup childCreation="deferred" autoCancel="disabled" id="p4">
                                        <af:panelWindow id="pw9" title="Delete user">
                                            <af:panelFormLayout id="pfl6">
                                                <af:panelLabelAndMessage label="ID:"
                                                                         id="plam16">
                                                    <af:outputText value="#{userController.selectedUser.user_id}" id="ot50"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="Firstname:"
                                                                         id="plam17">
                                                    <af:outputText value="#{userController.selectedUser.firstname}" id="ot51"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="Lastname:"
                                                                         id="plam18">
                                                    <af:outputText value="#{userController.selectedUser.lastname}" id="ot52"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="Address:"
                                                                         id="plam19">
                                                    <af:outputText value="#{userController.selectedUser.address}" id="ot53"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="City:" id="plam20">
                                                    <af:outputText value="#{userController.selectedUser.city}" id="ot54"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="Username:"
                                                                         id="plam21">
                                                    <af:outputText value="#{userController.selectedUser.username}" id="ot55"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="E-mail:" id="plam22">
                                                    <af:outputText value="#{userController.selectedUser.email}" id="ot56"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="Registration:"
                                                                         id="plam23">
                                                    <af:outputText value="#{userController.selectedUser.regdate}" id="ot57">
                                                        <af:convertDateTime pattern="#{userController.selectedUser.regdate}"/>
                                                    </af:outputText>
                                                </af:panelLabelAndMessage>
                                            </af:panelFormLayout>
                                            <af:commandButton text="Delete" id="cb18"
                                                              inlineStyle="width:80pt; margin:10px 0px 0px 0px;"/>
                                        </af:panelWindow>
                                    </af:popup>When I cut out row: selectionListener="#{userController.selectedUser}
    Popup (for deleting user) looks like this:
    http://imageshack.us/photo/my-images/404/popupc.jpg/
    I need to get the outputs from <af:outputText> in this popup.
    Thanks for help.
    Edited by: user9202624 on 26.2.2013 7:52

    thanks for answer.
    I added partialTriggers in af:table
    <af:table var="user" rowBandingInterval="0" id="t2"
                                                  inlineStyle="margin:20px 30px; width:578pt; height:160pt;"
                                                  value="#{userController.users}"
                                                  rows="15"
                                                  emptyText="#{bindings.UsersprototypView11.viewable ? 'No data to display.' : 'Access Denied.'}"
                                                  fetchSize="#{bindings.UsersprototypView11.rangeSize}"
                                                  editingMode="clickToEdit" rowSelection="single"
                                                  selectedRowKeys="#{userController.selectedUser}"
                                                  partialTriggers="::t1" >What next ? What should I do next ? Sry, I'm newbie in adf and jDev.
    Edited by: user9202624 on 26.2.2013 8:55

  • Is there  a way to make Safari open PDF pages without opening Finder and select Reader from my applications folder?

    Simple, When I want to open a .pdf page from the web, I get Finder to open and I have to go to my applications folder to pick up Acrobat reader, Is there a way to have Safari doing it all by itself, Preview, or any other program?

    Right or control click a PDF file you have on the hard drive then click: Get Info
    In the Get Info panel click the pop up menu next to:  Open with
    Select the app you want to open PDF files from the pop up menu then click:  Change All

  • [UIX-ADF] How to get the selected row in my ViewObjImpl.java

    Hi,
    I have a uix table with a select column. I dragged my method from my ViewObjImpl
    and dropped it on the select column (radiobutton) as a submitbutton.
    If I run my application and select a row and press my button it always reads the first
    row. Why?
    I also tried including a param in my method, for the record id, but I dont know what to
    pass to my action binding as a param, where can I find the selected row?
    This is what I want, my method in ViewObjImpl.java
    public void doDelete() {
      ViewObjRowImpl pRow = (ViewObjRowImpl)this.getCurrentRow();
      try {
        pRow.setIsDeleted("Y");
        //this.executeQuery();
        this.getDBTransaction().commitAndSaveChangeSet();
        //this.validate();
      } catch(Exception e) { System.out.println("ERROR doDelete" + e);  }
    }It should set the IsDeleted field to 'Y' for the selected row. Perhaps im not doing the
    right thing for this?
    Can anyone give me some pointers?
    Thanks in advance
    Ido

    Thanks. So even if you select a row and then press the button, your method still only finds the first row?!
    Are you sure that the selection mechanism of your table is working? Your tableSelection fires a select event and your page contains a select handler?
    When you wire your page using drag and drop the binding should always use the default iterator of the ViewObject. And getCurrentRow() should always give you the current row of that iterator. So my feeling is that the selection doesn't take place.
    Or could it be that something resets the currency in the ViewObject from another place?
    Sascha

  • How to get selected Row/Cell value in i5Grid

    Hi Friends,
    Can anyone help to how to find the selected Row/Cell value of a i5Grid object. I am able to register the event handlers which are getting invoked on row/cell selection. But I want to know how can I get the value of selected Cell/Row. I would like to add selected Items from one i5Grid to another one.
    So want to know how can I get and set the value of i5Grid object.
    MII version 14.0 SP4 Patch
    Thank in advance
    Shaji Chandran

    Hi Shaji,
    Here is my code.
    <!DOCTYPE HTML>
    <HTML>
    <HEAD>
        <TITLE>Your Title Here</TITLE>
        <META http-equiv="X-UA-Compatible" content="IE=edge">
        <META http-equiv='cache-control' content='no-cache'>
        <META http-equiv='expires' content='0'>
        <META http-equiv='pragma' content='no-cache'>
        <SCRIPT type="text/javascript" src="/XMII/JavaScript/bootstrap.js" data-libs="i5Chart,i5Grid,i5SPCChart"></SCRIPT>
        <SCRIPT>
            var Grid = new com.sap.xmii.grid.init.i5Grid("STC/C5167365/i5Grid_TagQuery", "STC/C5167365/TagQuery");
            Grid.setGridWidth("640px");
            Grid.setGridHeight("400px");
            Grid.draw("div1");
        function setCellValue()
        Grid.getGridObject().setCellValue(1,1,"Set");
        function setCellValueAgain()
        Grid.getGridObject().setCellValue(1,1,"Changed Again");
        </SCRIPT>
    </HEAD>
    <BODY>
        <DIV id="div1"></DIV>
        <INPUT type="Button" value="setCellValue" onClick="setCellValue()"/>
        <INPUT type="Button" value="setCellValueAgain" onClick="setCellValueAgain()"/>
    </BODY>
    </HTML>
    Regards,
    Sriram

  • How to programatically select different JTable cells

    Dear all,
    I need to programatically select different JTable cells.
    I have to make the inverse selection. So if the user has a table of one column and 10 rows, and selects rows 3,6,8, the inverse selection should select all the other remainig cells and deselect 3,6, and 8.
    I tried using the following but it does not work ?
    for (int i = 0; i < table.getRowCount(); i++) {
    table.changeSelection(i, 0, true, false);
    Hope someone can help.
    Regards,
    Kanita

    Dear all,
    I need to programatically select different JTable cells.
    I have to make the inverse selection. So if the user has a table of one column and 10 rows, and selects rows 3,6,8, the inverse selection should select all the other remainig cells and deselect 3,6, and 8.
    I tried using the following but it does not work ?
    for (int i = 0; i < table.getRowCount(); i++) {
    table.changeSelection(i, 0, true, false);
    Hope someone can help.
    Regards,
    Kanita

  • How to identify the Selected row number or Index in the growing Table

    Hi,
    How to find the selected Row number or Row Index of growing  Table using Javascript or Formcalc in Interactive Adobe forms
    Thanks & Regards
    Srikanth

    After using bellow script it works fine
    xfa.resolveNode("Formname.Table1.Row1["this.parent.index"].fieldname").rawValue;

  • How can I find and edit my website on iWeb? It has disappeared

    I created my website on iWeb and published it on Google.  I have revised it a couple of times but now, when I open iWeb, the website is not there.  I just get a new templatae.  "Visit" is unavailable. If I try to open it from the Finder via iWeb, it goes to the same place.  PS-I just upgraded to Lion!

    In Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    To open your domain file in Lion or to switch between multiple domain files Cyclosaurus has provided us with the following script that you can make into an Applescript application with Script Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an application.
    do shell script "/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"delay 1
    tell application "iWeb" to activate
    You can download an already compiled version with this link: iWeb Switch Domain.
    Just launch the application, find and select the domain file you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
    WARNING: iWeb Switch Domain will overwrite an existing Domain.sites2 file if you select to create a new domain in the same folder.  So rename your domain files once they've been created to something other than the default name.
    OT

  • Pages 5: Find and replace special characters

    Has this feature gone? Or can anyone tell me where to find it? I neeed, for example, to replace double paragraph breaks with single ones, how can I do this?

    I can't find it either, but the following appears to work:
    Turn on Show Invisibles in the View menu.
    Select (highlight) the double para breaks.
    Use Command-E  (Find using selected text).
    Open the Find dialogue box (Command-F) and select Find & Replace.The selected para breaks will be in the Find text entry box, but will not be visible!
    Click in the Replace text entry box.
    Select (highlight) a single para break.
    Go to the Edit menu / Find and select 'Use selection for replace' (it will not show in the Replace entry box).
    In the Find & Replace dialogue box, click on the Forward or Back arrows to highlight the selected items (e.g. double para break) where you wish to start replacing in the document.
    Use the Replace All / Replace & Find / Replace buttons as per usual.
    Not a nice solution, but I hope it gets you going until Apple restores the previous functionality!

  • How to select row automatically in matrix (exp:automatic select row no 2)?

    Hi
    example i fill matrix row no 1 - 3 in serial number selection form or else (from database data)
    and i want to automatic select row no 2
    and i really have a big problem to do this
    oQuant = edit text
    oColumn = column
    oForm = form
    here some of my code
    ====================================
    formID = pVal.FormUID
    Set oForm = SBO_Application.Forms(formID)
    Set oMatrix3 = oForm.Items.Item("5").Specific
    Set oColumn3(3) = oMatrix3.Columns.Item("19")
    Set oQuant(5) = oColumn3(3).Cells.Item(2).Specific
    =====================================
    i tried
    oMatrix3.SelectRow 2, True, False
    but it didn't work , it's said that not user defined item
    oQuant(5).Active = True
    it works but that not the select what i want
    pls some one help me
    i really need it right away
    Thanks

    Hi chetan
    Thank You for your reply and yes i didn't write selection mode for my matrix
    but when i tried both of these code it still didn't work (for information i'm using visual basic 6, so it has a different syntax about .net and VB6 - exp: for .net  oMatrix.selectrow(2,true,false) , for VB6 oMatrix.selectrow 2,true,false )
    oMatrix.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Auto
    oMatrix.SelectRow 2, True, False
    oMatrix.SelectionMode = ms_Auto
    oMatrix.SelectRow 2, True, False
    is there any presiquities for selection mode ?? because I always have <b>warning</b> on oMatrix.selectionmode
    "<b>Item - the item is not user defined item</b>"
    Edit : it works when i created a form and select row no 2,  but it didn't work with serial number selection form which the form is already exist in SBO (serial number selection is the form after klik add button in good issue form)
    Thanks

Maybe you are looking for

  • Order to cash cycle - IDocs Involved

    Hi experts, Im a XI consultant and ive been given the job of creating a business package in XI for the Order to Cash process. Since i cant directly execute TCODEs from XI i will map all the required data to all the IDocs involved in the Order to cash

  • Give access only one form module for a particular person.

    i have four form module like accounts,import,export,HR, each module has number of menus. I have to give a person to access only the module(accounts). when that particular person login into home page, he has to see the accounts module only. How to do

  • Punchout catalog is not opening for a user

    Hi Sap Gurus, We have one punch-out catalog which is configured in the SRM system. This catalog is assigned to users. One particular user is not able to access this catalog and she gets the error indicating that "page cannot be displayed". Apart from

  • Can this product convert a sideways PDF to Excel?

    I have a PDF that is obviously an excel spreadsheet scanned in sideways and when I try to run it through the export program, I get a file of junk. Any ideas>?

  • VIZ charts....help please

    Hi All, I have created some charts which will open inside the dialog boxes.... When we click the button to open the dialogue box it is popping up but with blank content, once we just drag and touch the edge of the box chart appears in front. It is st