Dynamic use of JTable

I have a JTable which holds a number of columns (these are fix). Now my
problem is that this table can change at any time by an event in the table.
I create my rows and data by a table model.
Those anyone have a idea how I can make the JTable dynamic. So I can easly change the number of rows by an event on the table itself or by a event on the Frame?
Thanks

Hi,
I can't see your problem - if you use a subclass of AbstractTableModel for your table model, which has for example n entries (perhaps hold in a Vector of Vector like DefaultTableModel does it) and you have added for example x rows, simply fireTableRowsInserted(n,n+x-1) of the table model and JTable will update its display correctly. If you delete for example row y simply fireTableRowsDeleted(y,y) - you just have to fire the correct notification message and inform the listeners of the table model about that, what you have done, and the display will keep updated correctly. If you change the whole data vector but keep the structure of the table, simply fireTableDataChanged() - if the data vector and the structure of the table changes, fireTableStructureChanged() - you see, just inform the TableModelListeners about that, what you have done in the table model, and the table will be updated correctly as so the JTable itself is a TableModelListener to its model.
Perhaps you can be more specific about what your problem is
greetings Marsian

Similar Messages

  • Dynamically Updating a JTable

    I am developing an EPOS system using java, that uses a JTable to display the recipt, before it is printed.
    I have a class for the recipt data, stored in a vector which works and using observers fires events to the gui when things are added etc. My problem comes when i try to dynamically change the tables content, my idea was to create a new table, fill it with the new data, set the scroll pane around the new table and call revalidate to show the new table.
    This is possible but seems far too much work to just update a table! I would also assume the amount of extra garbage collection would require extra processing that seems pointless.
    Is there another way i could do it? Ideally i just want to refresh the content in the table for each update sent by the observable.
    Thanks

    Make your TableModel observe your observable and update it's contents. Remember to fire the appropriate event after the update.

  • How to include Forward button dynamically using code?

    hello,
    i am creating my notification message dynamically using clob type document type attribute , and its working fine. But how i include the Forword Button in my message body.
    please advice

    i am allready doing that only, in that what will be the name of the button.
    can i put like this.
    htp.p( '<input type="button" name="forward">');
    then what about the event, shall i have to write the code for forward also.
    please advice.

  • Dynamic USING clause in execute immediate

    Hi All,
    Is it possible to build a dynamic using clause in execute immediate command.
    EXECUTE IMMEDIATE <dynamic query> USING <dynamic clause>;
    Rgrds,
    Nitin.

    Hi,
    The problem is I have a query in which in some scenarios I want just one column in where clause, in other scenario I need 2 columns in the where clause.
    So I would have to write 2 different queries.
    execute immediate 'SELECT 1 FROM DUAL WHERE 1 = :bind1' into a using 1;
    execute immediate 'SELECT 1 FROM DUAL WHERE 1 = :bind1 AND 2 = :bind2' into a using 1, 2;
    Is there any way I can achieve this in a single query like:
    dynamic_using_str varchar2(100);
    dynamic_using_str := '1';
    execute immediate 'SELECT 1 FROM DUAL WHERE 1 = :bind1' into a using dynamic_using_str;
    dynamic_using_str := '1, 2';
    execute immediate 'SELECT 1 FROM DUAL WHERE 1 = :bind1 AND 2 = :bind2' into a using dynamic_using_str;
    ~Nitin.
    Edited by: user13060845 on Apr 30, 2010 12:29 PM

  • Want to send information in Header dynamically using HTTP adapter using post method

    Hi ,
    I have a requirement to send below information in http Adapter header dynamically using post method. which will be authenticated by third party system.
    Authorization : WSSE realm="SDP", profile="UsernameToken", type="AppKey" X-WSSE : UsernameToken Username="XXXX", PasswordDigest="Qd0QnQn0eaAHpOiuk/0QhV+Bzdc=", Nonce="eUZZZXpSczFycXJCNVhCWU1mS3ZScldOYg==", Created="2013-09-05T02:12:21Z"
    I have followed below link to create UDF
    http://scn.sap.com/thread/3241568
    As if now my third party system is not available while sending request I am getting 504 gateway error. is there any approach I can validate my request is working fine?
    Regards,

    Hi Abhay,
    Correct me if I'm wrong but I think WSSE requires a SOAP Envelope. If that is the case, there are two approaches: the first one is to use SOAP Axis and the second one is just to build SOAP Envelope via Java mapping.
    You also need to test it successfully externally, capture the request and replicate it in XI.
    Hope this helps,
    Mark

  • Dynamic Use of web dynpro component

    Hi,
    How can I dynamically use the web dynpro component for display in one component with out using Wdb Dynpro Interface component?
    I want to give user a dash board which is configurable by the user.
    Thanks and regards,
    Pradip

    >
    Pradip R[https://cw.sdn.sap.com/cw/docs/DOC-37733
    > Hi Bhaskar,
    > My components are not in used componenty. In runtime user will search the component in server and shall embedd in my application. So component usage is also dynamic.
    > Any suggestion?
    > Regards,
    > Pradip
    Hi,
    see the link here
    [https://cw.sdn.sap.com/cw/docs/DOC-37733|https://cw.sdn.sap.com/cw/docs/DOC-37733].
    as advised, you create a usage group for dynamic components, add component usages to the group based on your conditions.

  • Can a transaction be called in background dynamically using ABAP program??

    Hi Experts,
    Can a transaction be called in background dynamically using ABAP program without BDC???
    Regards,
    Mansi.

    u can create job dynamically through programming..Try this sample code..
    data: jobname like tbtcjob-jobname value
                                 ' TRANSFER TRANSLATION'.
    data: jobcount like tbtcjob-jobcount,
          host like msxxlist-host.
    data: begin of starttime.
            include structure tbtcstrt.
    data: end of starttime.
    data: starttimeimmediate like btch0000-char1.
    Job open
      call function 'JOB_OPEN'
           exporting
                delanfrep        = ' '
                jobgroup         = ' '
                jobname          = jobname
                sdlstrtdt        = sy-datum
                sdlstrttm        = sy-uzeit
           importing
                jobcount         = jobcount
           exceptions
                cant_create_job  = 01
                invalid_job_data = 02
                jobname_missing  = 03.
      if sy-subrc ne 0.
                                           "error processing
      endif.
    Insert process into job
    SUBMIT zreport and return               << Here it is a static call but u can make it dynamic
                    with p_param1 = 'value'
                    with p_param2 = 'value'
                    user sy-uname
                    via job jobname
                    number jobcount.
      if sy-subrc > 0.
                                           "error processing
      endif.
    Close job
      starttime-sdlstrtdt = sy-datum + 1.
      starttime-sdlstrttm = '220000'.
      call function 'JOB_CLOSE'
           exporting
                event_id             = starttime-eventid
                event_param          = starttime-eventparm
                event_periodic       = starttime-periodic
                jobcount             = jobcount
                jobname              = jobname
                laststrtdt           = starttime-laststrtdt
                laststrttm           = starttime-laststrttm
                prddays              = 1
                prdhours             = 0
                prdmins              = 0
                prdmonths            = 0
                prdweeks             = 0
                sdlstrtdt            = starttime-sdlstrtdt
                sdlstrttm            = starttime-sdlstrttm
                strtimmed            = starttimeimmediate
                targetsystem         = host
           exceptions
                cant_start_immediate = 01
                invalid_startdate    = 02
                jobname_missing      = 03
                job_close_failed     = 04
                job_nosteps          = 05
                job_notex            = 06
                lock_failed          = 07
                others               = 99.
      if sy-subrc eq 0.
                                           "error processing
      endif.
    Regards,
    JOy.

  • Problem in creating program dynamically using FM 'rss_template_instantiate'

    hi everyone,
    i need to create the program dynamically using FM 'RSS_TEMPLATE_INSTANTIATE'.
    if we create the program using this function module can we see the generated code.
    very urgent!!!!!
    thanks in advance.
    regards,
    bharat.

    hi everyone,
    i need to create the program dynamically using FM 'RSS_TEMPLATE_INSTANTIATE'.
    if we create the program using this function module can we see the generated code.
    very urgent!!!!!
    thanks in advance.
    regards,
    bharat.

  • Possible to generate graphics dynamically using ABAP?

    Hello friends,
    It is possible to generate graphics dynamically using ABAP as programming language? In the same line like SVG (Scalable Vector Graphics) or ChartDirector?
    Output of this abap program should be a picture.
    Daniel

    Hi Daniel,
    Have a look at URL
    http://help.sap.com/saphelp_nw04/helpdata/en/0c/5c55a8d0a611d2963100a0c9308b1f/content.htm
    Also have a look at SGRB Package/deveoplment class.
    Thanks
    Lakshman
    Message was edited by: Lakshman Tandra

  • Insert a trademark symblol to my swf dynamicly using XML

    hello there,
    i am trying to insert a trademark symblol to my swf dynamicly
    using XML,
    i tried every thing i could "caved the xml in every format
    known to man kind, wrote some AS script to replace thin join, i
    tried to hard code the symble" but nothing worked.
    i am running flash8.
    help is needed plz.
    today is the DEAD LINE.
    plz.

    Okay, test files are up in the following directory:
    www.saffronthread.com/test
    You can guess which ones are for you. I didn't deal with the
    whole IE stupidness, so you my need to click on the page. But I've
    got several different text fields some runtime some author
    environment and sample text. Works for me on Mac and on the PC I
    checked. Let me know what you find out.
    As for System.useCodePage it is very seldom an actual
    solution to the problem. It is a solution for when you want to be
    sure that the user's Flash Plugin uses the computer's code page for
    text rendering. Read the help entry for it and you will see that it
    is not a solution for making sure that the most people possible
    will correctly receive my text. It is more a solution for, I want
    to make sure that those with Chinese operating systems are able to
    correctly see the Chinese text I have encode with my special
    encoding.
    Most questions that get a "Oh, you must use
    System.useCodePage answer" are more like, "I want to make sure that
    everybody on every type of system can see my special characters."
    The answer for that tends toward proper use of UTF-8 and that is my
    guess for your problem. That your XML file is not being saved as
    UTF-8. If System.useCodePage is helping you that tells me that your
    XML editor is saving to some odd (maybe very popular, but not
    UTF-8) encoding.

  • Dynamically use page number in form field on spawned pages?

    I have a form with spawned pages.  JS for spawning page(s) works fine.  However, one text field on template is driving me nuts.  I would like this field ("CaseNum") to dynamically display page number, since page number also corresponds to case number.  On templage ("getcase"), I can calculate value for CaseNum using custom calc script (event.value = this.PageNum).  But that doesn't work because every spawned page gets the same value (ie, whatever is last spawned page number). I also tried JS below, using P0.getcase.CaseNum as the field on the template in which I want the page number/case number to be displayed:
    var oPage = this.pageNum;
      this.getField("P" + oPage + ".getcase" + ".CaseNum").value = oPage;
    But, this doesn't work either, because the field on the spawned page automatically gets the prefix of P + page number + .getcase appended to the field name.  Is there any way to dynamically used page number in a form field on spawned pages?  If so, how? Note that while I am trying to use a dynamic case number on spawned pages, it presents the same issue as dynamically displaying page numbers on spawned pages.  I'm a JS newbie, so any help appreciated.  I've searched high and low on web and in forums and couldn't find the answer.  Thx.

    http://forums.adobe.com/thread/1160899
    7.George Johnson,
    28-Feb-2013 09:42   in reply to natelfo
    Is this what you mean?
    Also see:
    http://www.planetpdf.com/developer/article.asp?ContentID=6466
    http://www.wordwizardsinc.com/blog/finding-the-fieldname-prefix-on-acrobat-acroform-spawne d-template-pages-using-javascript-functions/

  • Dynamic using clause

    Hi All,
    Is it possible to build a dynamic using clause in execute immediate command.
    EXECUTE IMMEDIATE <dynamic query> USING <dynamic clause>;
    If not, is there any alteranate approach there?
    Regards
    Swaminathan

    "there is no such thing as a dynamically generated USING clause."
    Ask Tom &amp;quot;Returning cursor from stored procedure u...&amp;quot;
    Tom's referring to the following approach as an alternive: http://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:1288401763279

  • Table to load dynamically using sqlloader.

    how to specify which table to load dynamically using sqlloader. We are using sqlldr in a script as given below...
    sqlldr user/pass control=/control/loader.ctl log=/log/logger.log bad=/bad/badrec.bad data=/data/d1.txt

    Hello, you'd need to build the necessary control files through a shell script, here is an example:
    # Write sqlplus commands to control_file.sql
    echo "set head off
    set feedback off
    set pagesize 0
    set termout off" > control_file.sql
    # read table and column list from table.dat
    more table.dat |awk '{print $1}' |
    while read TAB
    do
            echo "Table ${TAB}"
            read COLUMNS
            STR="nothing"
            if test "$TABLE_LIST" = "empty"
            then
                    TABLE_LIST="'$TAB'"
            else
                    TABLE_LIST="$TABLE_LIST,'$TAB'"
            fi
    # construct select to load data - creating SQL*Loader control files
            echo "set head off\n
            set feedback off\n
            set pagesize 0\n
            select column_name||' '||
            decode(data_type,'VARCHAR2',' char ('||DATA_LENGTH||')',
            'CHAR',' char ('||DATA_LENGTH||')','DATE',' date (20) \"DD-MON-YYYY HH24:MI:SS\"','')
            from user_tab_columns
            where table_name ='$TAB'
            order by 1;\n" | $ORACLE_HOME/bin/sqlplus -s $USR | awk '{print $1" "$2" "$3" "$4" "$5}' |
    # read the columns in and concatenate them together to form the control file select
            while read COLUM
            do
                    if test "$STR" = "nothing"
                    then
                            STR="\nspool $TAB.CTL\nselect 'LOAD DATA\nINFILE \"$TAB.DMP\"\nBADFILE \"$TAB.BAD\""
                            STR="$STR\nDISCARDFILE \"$TAB.DIS\"\nDISCARDMAX 99\nTRUNCATE"
                            STR="$STR\nCONTINUEIF LAST != \"$FIELD_ENCLOSURE2\"\nINTO TABLE $TAB"
                            #STR="$STR INTO TABLE $TAB"
                            STR="$STR\nFIELDS TERMINATED BY \"$FIELD_DELIMITER\""
                            STR="$STR ENCLOSED BY \"$FIELD_ENCLOSURE\" AND \"$FIELD_ENCLOSURE2\""
                            STR="$STR\n TRAILING NULLCOLS"
                            STR="$STR\n($COLUM"
                    else
                            STR="$STR,\n$COLUM"
                    fi
            done
            STR=" $STR)'\nFROM DUAL;\nspool off\n"
            echo "$STR" >> control_file.sql
    done

  • How use the jtable in java applete

    hi master
    sorry i again Disturb you
    sir pleae give me idea how i use the jtable in java applete
    please send me code
    thank's
    aamir

    Hi,
    see http://www.exampledepot.com/
    Frank

  • Populate the selectOneListbox Dynamically using Query.. Frank plz check

    Hi,
    I am using JDeveloper 11G
    How Can I populate the selectOneListbox Dynamically using Query in Jsp pages...
    Kindly let me know...
    Thanks in advance
    Jithesh

    try this,
    public SelectItem[] getSelectOneList() {
    DCIteratorBinding testListIter1 = getItrtBindings("ViewObj1Iterator");
    ViewObject vo1 = testListIter1.getViewObject();
    //vo1.setNamedWhereClauseParam("id", someid);
    vo1.executeQuery();
    DCIteratorBinding iter= getItrtBindings("ViewObj1Iterator");
    int startIdx = iter.getRangeSize();
    iter.setRangeSize(-1);
    Row[] rows = iter.getAllRowsInRange();
    SelectItem[] selectOneList = new SelectItem[rows.length];
    SelectItem item = null;
    if(rows != null && rows.length > 0){
    for(int i=0; i<rows.length; i++){
    Row r = rows;
    String attribute = r.getAttribute("FunctName").toString();
    String label = r.getAttribute("FunctName").toString();
    item = new SelectItem();
    item.setValue(attribute);
    item.setLabel(label);
    selectOneList[i] = item;
    iter.setRangeSize(startIdx);
    return selectOneList;

Maybe you are looking for

  • Help with seting up a Data Sorce can't be created with non-existent Pool

    I am wanting to use an Oracle 9i with WebLogic 7 I have the following in my config.xml: <JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver" Name="Thin.Pool" Password="{3DES}C3xDZIWIABA=" Properties="user=SYSTEM" TestTableName="OID" URL="

  • Optical drive is not being recognized by OS

    Can anyone help me? When I insert a disk the drive spools up and then stops. The disk is not recognized and then the disk will not eject. When I open DVD player it says that there is an initilization error and that there is no drive recognized. Can a

  • Unable to add visual composer UI to a BPM task in CE 7.2.

    Hello I am using CE 7.2 trial version. I am not able to add a visual composer UI component to a task (BPM task). Can any body explain how to do? I have created the visual composer component and deployed in the server. It is working fine independently

  • Saved Shopping Cart Display/Edit functions are not working

    Hello SRM experts, The problem that I have is that the buttons like Display, Edit, etc are not working on a saved Shopping Cart. What is the best way to debug this problem? How would I find out what methods are being called on the SRM system or if so

  • Q: looking for a best practices on a reorg issue

    I am trying to figure out how to reorg our BW PSAPODSD and PSAPODSI tablespaces.  They both have partitions which seems to complicate the issue a tad.  What I am trying to do is move the data to new tablespaces (PSAPTESTD and PSAPTESTI, drop the old