URGENT - How to change data in a table

I have created the basic table to display some data. But how do I change some of the data in the table. I generate the data within my program and then need to display the new table data in the same original table.

So far I am just testing with the example codes from the sun website. How would I change the name Mary to say Kate? Do I have to implement an abstract table model? Can I just change the value in the array or something?
Thanks in advance
// create the table
               Object[][] tableData =
            {"Mary", "Campione",
             "Snowboarding", new Integer(5), new Boolean(false)},
            {"Alison", "Huml",
             "Rowing", new Integer(3), new Boolean(true)},
            {"Kathy", "Walrath",
             "Chasing toddlers", new Integer(2), new Boolean(false)},
            {"Mark", "Andrews",
             "Speed reading", new Integer(20), new Boolean(true)},
            {"Angela", "Lih",
             "Teaching high school", new Integer(4), new Boolean(false)}
          String[] columnNames = {"First Name",
                                "Last Name",
                                "Sport",
                                "# of Years",
                                "Vegetarian"};
          final JTable table = new JTable(tableData, columnNames);
        table.setPreferredScrollableViewportSize(new Dimension(500, 100));
          //Create the scroll pane and add the table to it.
        JScrollPane scrollPane = new JScrollPane(table);
          //Add the scroll pane to this window.
        //getContentPane().add(scrollPane, BorderLayout.CENTER);
          displayPanel.add(scrollPane);

Similar Messages

  • Its very urgent:how to insert data into database tables

    Hi All,
    I am very new to oaf.
    I have one requirement data insert into database tables.
    here createPG having data that data insert into one custom table.
    but i dont know how to insert data into database tables.
    i wrote the code in am,co as follows.
    in am i wrote the code:
    public void NewoperationManagerLogic()
    ManagerCustomTableVOImpl vo1=getManagerCustomTableVO1();
    OADBTransaction oadbt=getOADBTransaction();
    if(!vo1.isPreparedForExecution())
    vo1.executeQuery();
    Row row=vo1.createRow();
    vo1.insertRow(row);
    in createPG processrequest co:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.NewoperationManagerLogic();
    process form request:
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if(pageContext.getParameter("Submit")!=null)
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.getOADBTransaction().commit();
    please help with an example(sample code).
    its very urgent.
    thanks in advance
    Seshu
    Edited by: its urgent on Dec 25, 2011 9:31 PM

    Hi ,
    1.)You must have to create a EO based on custom table and then VO based on this EO eventually to save the values in DB
    2.) the row.setNewRowState(Row.STATUS_INITIALIZED); is used to set the the status of row as inialized ,this is must required.
    3.) When u will create the VO based on EO the viewattributes will be created in VO which will be assigned to the fields to take care the db handling .
    You must go thtough the lab excercise shipped with you Jdeveloper ,there is a example of Create Employee page ,that will solve your number of doubts.
    Thanks
    Pratap

  • How to change data in decision table using excel file in operating system?

    Hello, BRF Experts
    I now brf + for the first time in the current project is being developed.
    Now, project has been facing a big problem.
    Develop system that was developed in the history of decision table in the operating system can be used to update excel file, etc. I do not know whether.
    So, I was tested, but can not change data in decision table.
    [ error message : system is not change allowed ].
    The operating system itself to the current system setting is immutable and check it
    : changes and transports for client-specific object -> no changed allowed
    : cross-client object changes -> no changes to repository and cross-client customizing object.
    Decision table in the operating system can update the details if I want to know what to do.
    Maintenance view can be modified in the operating system as a decision table, I wonder if you can create a view.
    Edited by: Sung-Wook Ha on Jan 13, 2012 2:02 PM

    Hi ,
    Exchanging data with Microsoft Excel is done with the help of the XML-based file format (file extension .XSLX) introduced with Microsoft Excel 2007. If you are using an older version of Microsoft Office, you can download the Microsoft Office Compatibility Pack to upgrade the supported file formats from the Microsoft Download Center ([Exchanging Decision Table Data With Microsoft Excel |http://www.microsoft.com/downloads/details.aspx?familyid=941b3470-3ae9-4aee-8f43-c6bb74cd1466]). Once you have downloaded the Compatibility Pack, you have to install it on every workstation that has an older version of Microsoft Office installed.
    Please refer the link-
    [BRFplus-Data exchange with MS Office 2007|http://help.sap.com/erp2005_ehp_05/helpdata/en/b8/e03486d1df48c6baa3c4354f5198ee/frameset.htm]
    Hope this helps.
    Thanks,
    Ajay

  • How to change data element in table?

    Hello all:
          I just need to change data element for a field in some Z table. I know I can do it through SE11 but I just want to make sure if there is anything I should be aware of? Are there any other steps I should perform apart from making changes through SE11? Any information you could provide would be great.
    Thanks.
    Mithun

    Hi Mithun,
    Yes, you can change the table using SE11. After saving, check for errors and activate. Using Menu, Utilities
    -> click on Database Utility and then click on 'activate and adjust database'.
    Hope this helps.
    Thanks,
    Srinivasa
    Message was edited by:
            Srinivasa Bhanuprasad Moningi

  • HOW TO CHANGE DATA IN STANDARD TABLE

    PLEASE HELP AS PER ABOVE.
    THANKS,
    LALIT

    Hi,
    You can use the statements UPDATE / MODIFY to change the DATA in a database table
    UPDATE
    The statement UPDATE changes the content of one or more lines of the database table specified in target. The entries in source determine which columns of which lines are changed, and how they are changed.
    System fields
    The statement UPDATE sets the values of the system fields sy-subrc and sy-dbcnt.
    sy-subrc Meaning
    0 At least one line has been changed.
    4 At least one line was not able to be changed, either because no appropriate line was found, or because the change would generate a line that leads to double entries in the primary key or a unique secondary index in the database table.
    The statement UPDATE sets sy-dbcnt to the number of changed lines.
    The changes are definitively copied to the database with the next database commit. Until that point, they can still be undone using a database rollback.
    MODIFY
    ex - modify <dbtab> from TABLE it_tab.
    The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines.
    System fields
    The MODIFY statement sets the values of the sy-subrc and sy-dbcnt system fields.
    sy-subrc Meaning
    0 At least one line is inserted or changed.
    4 At least one line could not be processed since there is already a line with the same unique name secondary index in the database table.
    The MODIFY statement sets sy-dbcnt to the number of processed lines.
    The changes are transferred finally to the database table with the next database commit. Up to that point, they can be reversed using a database rollback.

  • How to change data in item table in sales order in  UI

    Hi Experts ,
    i have 5 products line items in my item table in UI in sales order and i want to change the status of third line item on the basis of some condition .
    please guide me how to do it .
    thnx in advance

    Hi Abhinav,
    You can assign a status profile to the item category of Item 3. Then set the condition depending on the new status profile.
    Hope this helps..
    Regards,
    Shwetha

  • How to select data from a table using a date field in the where condition?

    How to select data from a table using a date field in the where condition?
    For eg:
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
                                                      and bdatu = '31129999'.
    thanks.

    Hi Ramesh,
    Specify the date format as YYYYMMDD in where condition.
    Dates are internally stored in SAP as YYYYMMDD only.
    Change your date format in WHERE condition as follows.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and bdatu = <b>'99991231'.</b>
    I doubt check your data base table EQUK on this date for the existince of data.
    Otherwise, just change the conidition on BDATU like below to see all entries prior to this date.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and <b> bdatu <= '99991231'.</b>
    Thanks,
    Vinay
    Thanks,
    Vinay

  • How to change date format in select-option (mm.yyyy).

    Hi,
       Plz, How to change date format in select-option (mm.yyyy).
      in my selection screen date type selection-option is there ,when i am enter date   it's  taken  dd.mm.yyyy format,but i want mm.yyyy format.
    how to set that .
    Regards,
    Kk.

    sorry
    parameters : pmonyr type spmon or
    select-options : sspmon for PGPL-spmon .
    or what table ccontains spmon.
    regards
    shiba dutta

  • How to send data from internal table to the shared folder in ABAP

    Hi experts,
             My requirement is to transfer data from a file to shared folder. i just did reading data from a file to a internal table. Now i want to send this internal table data into a shared folder which is  "
    xxx\y\z....".
    I do not have any idea on how to send data from internal table to the shared folder path.
    can anybody please help me out how to do this?
    Thanks & Regards
    Sireesha.

    Where that folder is located, its on presentation server i.e. desktop or application server.
    If its on presentation server, use FM GUI_UPLOAD.
    If its on application server, then use DATASET functions. Have a look at below link.
    [File Handling in ABAP|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm]
    I hope it helps.
    Thanks,
    Vibha
    Please mark all the useful answers

  • How to select data from a table by passing document number from another tab

    How to select data from a table by passing document number from another table.
    for eg:-
    I want to display name, adres, region from ADRC table
    by using field delivery document number
    Kind Regards,
    Shanbagavalli.S

    Hi Shanbagavalli,
    There are multiple solutions to this questions a few i will try to answer and then you can take the best required for your requirements.
    **Consider that you have a Internal table having document number from other table..
    SELECT NAME ADRES REGION FROM ADRC
           INTO IT_ADRC
           FOR ALL ENTRIES IN IT_DOC
           WHERE DOCUMENT_NO = IT_DOC-DOCUMENT_NO.
    **Consider that you have 1 document number then
    SELECT NAME ADRES REGION FROM ADRC
         INTO IT_ADRC
         WHERE DOCUMENT_NO = W_DOCUMENT_NO.
    Hope this solves your problem.
    Regards,
    Kunjal

  • Approaches to transfer changed data from a table to another table

    Hello expert,
    will you please show me all approaches to automatically detect and transfer changed data from a table to another table ? I don't need detail information, but a little comment for those approaches are more welcome.
    Many Thanks,
    Edited by: 843178 on 19-Dec-2011 2:04 PM

    You will want to review information on replication and similar methods
    In a nutshell:
    Replication allowed data to exist at more than one site and take the Master / original table data and clone it at a different site
    As tranporting all of the table data to a remote / clone site got more and more expensive we developed a method
    to identify just the 'diffs' and only send those from the master to the clone which needed only the diffs to become a clone of the master table
    This has many methods and options, but looking under key words such as
    - distributed transations
    - materialized views
    - replication
    ... are a few categories that will get you started

  • Error While enahling CDC(Change data capture) on Table.

    I am enabling Change data capture (CDC) on SQL server 2012 Enterprise edition(11.0.2100.60)
    . I am able to enable it on Database level with below SQL, but failed to enable on Table level.
    Use DatabaseName
    GO
    Exec sys.sp_cdc_enable_db 
    GO
    EXEC sys.sp_cdc_enable_table @source_schema = N'dbo',
                @source_name = N'TableName', @role_name = NULL
    GO
    Got Error like,
    'msg 22832, Level 16, State 1, Procedure sp_cdc_enable_table_internal, Line 623
    Could not update the metadata that indicates table [dbo].[TableName] is enabled for Change Data Capture. 
    The failure occurred when executing the command '[sys].[sp_cdc_add_job] @job_type = N'capture''. 
    The error returned was 22836: 'Could not update the metadata for database DatabaseName to indicate that a Change Data Capture job has been added. 
    The failure occurred when executing the command 'sp_add_jobstep_internal'. 
    The error returned was 14234: 'The specified '@server' is invalid (valid values are returned by sp_helpserver).'. 
    Use the action and error to determine the cause of the failure and resubmit the request.'. 
    Use the action and error to determine the cause of the failure and resubmit the request.'
    Would anyone help me to out of this?
    Thanks in advance..!!

    Related thread:
    http://social.technet.microsoft.com/Forums/sqlserver/en-US/fa0c2a52-63b5-4a39-9f35-fe6f0eb21d1d/change-data-capture-on-table?forum=sqldatawarehousing
    Make sure SQL Server Agent is running.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How to change data type of attribute in caf

    hi.
    this is my problem.
    i been added a attribute in an entity service called emloyee. named "Birthday", use the data type "com.sap.caf.core.date".
    when i tried modify the entity service, i hit exception about "DST Daylight Saving Time".
    because of DST, the date will add an hour such like "1957/04/01 00:00:00.0" to "1957/04/01 01:00:00.0", and com.sap.caf.core.date will throw an exception.
    is anyone had same problem like me?
    how to fixed it(if passable)?
    and, how to change data type?
    thanks.

    Hi Sruthi,
    all you need to do on this is open the report go to the parameters, select the parameter that you wish to change and click "Edit". This will allow you to change thefield to a date rather than a date time.
    Regards,
    Noel

  • How to change records in standard tables ?

    how to change records in standard tables ?

    HI,
    If you are asking from program..Then you can use BDC or BAPI to update the records in teh standard tables..
    OR
    use the corresponding tcode to update the record
    Thanks
    Naren

  • How to change data source name and context root during deployment

    Hi,
    Env:
    WLS 10.1.3
    JDev 11.1.1.6
    Hudson
    I need to deploy two instances of my ADF application on the same development enviroment. We are using Hudson to deploy. My question is how to change data source name and application context root before second deployment.
    Kuba

    I don't believe there is an inbuilt facility to do this.
    Previously how I've done this is when checking files out using Hudson jovs, before the build I then use an Ant extension called XmlTask (http://www.oopsconsultancy.com/software/xmltask/) to modify the required XML files.
    Can I ask why you're doing this in the first place please? Multi-tenancy? 2 versions of the same app?
    CM.

Maybe you are looking for

  • Crashes when trying to save image

    Since upgrading to Lion I get regular crashes when trying to save images using Photoshop elements. Extract from crash report: "Thread 12 Crashed:: Dispatch queue: TFSVolumeInfo::GetSyncGCDQueue 0   libsystem_c.dylib                       0x9129dc19 _

  • How to fetch the text dynamically from text modules

    Hello All, I have a requirement where the I need to print the Form in multiple languages. For this I have created textmodules and maintianed translations as well. But for Spanish and Portugese there are two version languages. For example Spain has Sp

  • Business English Pod - not available in Itunes Store Brazil

    Please, I would like to subscribe the podcast Business English Pod and there is a message from Itunes Store that the link is not available in Brazil. I have already asked the Business English Pod and they can`t do anything about it. Can you please gu

  • Am I able to use iCloud for apps etc?...

    My son has the iPhone 5c 8GB but the storage is rubbish, he's constantly having to delete stuff to free up some space, I can get him 20GB of extra storage for 79p a month, will he be able to use that storage for apps, music, photos etc?

  • PROGRAM - RFSEPA02

    This program is used to convert NON open item mangaed accounts to open item managed accounts. While executing this program I am getting message "please do not use this program". Can some one helpme on this