Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9142369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:46:07+00:00 2026-06-17T09:46:07+00:00

I want to replace value of variable array in index [0][2] that the name

  • 0

I want to replace value of variable array in index [0][2] that the name of coloumn title is “1/y”. Previous value is 0.0, I want to replace it with value of calculation result , but when I try to display it, its value is still 0.0, this my code

titleColoumn = new Object[]{"Time (Second)","Medicine", "1/y",  "x2", "X/Y", "Y^", "Error"};
                                    //0    1   2   3   4   5   6
         allData = new Double[][]  {{1.0,1.02,0.0,0.0,0.0,0.0,0.0},
                                    {2.0,0.667,0.0,0.0,0.0,0.0,0.0},
                                    {3.0,0.367,0.0,0.0,0.0,0.0,0.0},
                                    {4.0,0.278,0.0,0.0,0.0,0.0,0.0},
                                    {5.0,0.237,0.0,0.0,0.0,0.0,0.0},
                                    {6.0,0.187,0.0,0.0,0.0,0.0,0.0},
                                    {7.0,0.155,0.0,0.0,0.0,0.0,0.0},
                                    {8.0,0.156,0.0,0.0,0.0,0.0,0.0},
                                    {9.0,0.142,0.0,0.0,0.0,0.0,0.0},
                                    {10.0,0.111,0.0,0.0,0.0,0.0,0.0},
                                    {11.0,0.12,0.0,0.0,0.0,0.0,0.0},
                                    {12.0,0.097,0.0,0.0,0.0,0.0,0.0},
                                    {14.0,0.089,0.0,0.0,0.0,0.0,0.0},
                                    {15.0,0.079,0.0,0.0,0.0,0.0,0.0},
                                    {0.0,0.0,0.0,0.0,0.0,0.0,0.0}};

    tableObservation = new DefaultTableModel(allData, titleColoumn);
    table.setModel(tableObservation);

    int row,coloumn;
    //calculation 1/y
    row = 0;
    coloumn = 1;
    int inputRow = 0;
    int inputColoumn = 2;
    double onePerY;
    for(int a=0;a<allData.length;a++){
        onePerY = 1/allData[row][coloumn];
        //replace value
        allData [inputRow][inputColoumn] = onePerY;
        inputRow++;
        row++;
        System.out.println(onePerY);
    }    

What should I do, to be able to replace it ? all the assistance that you gave, I would appreciate it, thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:46:08+00:00Added an answer on June 17, 2026 at 9:46 am

    You update array value not TableModel value. Use jTable.getModel().setValueAt() passing inputRow, inputColoumn and appropriate value for them. Your model must be editable. If you use DefaultTableModel it’s editable by default.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to replace directive #define MAX_LINE 15 with variable value. For example of
I am new to AJAX and PHP. i want to Replace the Variable value
I want to replace the value of the tag <h2>..</h2> with the content of
I want to take an XML file and replace an element's value. For example
How can replace values as array by replace in javascript. I want done replace
I want to replace a regex with '*', but only if the regex is
I want to assign some default value to a property or want to replace
Maybe a strange title, but i have a situation where i want an output
I want to replace all threeletter words with new string. MsgBox display variable threeLetterWord
I have a template page and want to replace my placeholder variable used in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.