Is there a way to add a row to an already created table?

hello

I am testing the SDK example files.

There is a code that creates a new table and puts values ​​in it.
(SWriter.java)

But what I want is to load an already created document and control the table there.

Is there a way to add rows and data to an already created table rather than a new one using java code?

If you go to Table/Insert you can insert rows above and below.

Whatever you want to do with a TextTable object in Writer by user code:
TextTable objects are a mess, and you have to expect problems of many kinds.
This starts with the fact that there are “complex tables” containing merged ranges and or split cells. They don’t have a clear concept of rows and columns.
I also dont know an interface/service provided by the API for the insertion of rows/columns. The only way I can think of is to use the dispatcher simulating user interaction of the kind @edcdeee suggested. See provisional code below.

Sub insRowsAboveRangeIntoTextTable(Optional pDoc As Object, Optional pTextTable As Object, Optional pRangeName As String)
If IsMissing(pDoc) Then pDoc = ThisComponent

' <onlyfortesting>
If IsMissing(pTextTable) Then pTextTable = pDoc.TextTables(0)
If IsMissing(pRangeName) Then pRangeName = "A5:B7"  REM Case sensitive for TextTable!
' </onlyfortesting>

If InStr(pRgName, ":")=0 Then pRgName = pRgName &":"& pRgName REM Assuming pRgName was a cell name.
theRg = pTextTable.getCellRangeByName(pRangeName)

cCtrl = pDoc.CurrentController
dispatchPr = cCtrl.Frame
dispatchHe = createUnoService("com.sun.star.frame.DispatchHelper")

oldSel = pDoc.CurrentSelection
cCtrl.select(theRg)
dispatchHe.executeDispatch(dispatchPr, ".uno:InsertRowsBefore", "", 0, Array())
hasFailed=(pDoc.CurrentSelection.RangeName=pRangeName)
cCtrl.select(oldSel)
If hasFailed Then MsgBox("Attempted insertion of rows failed.")
End Sub  

For simple ranges you then can manipulate the content of the cells one by one, or -concerning simple content- the DataArray using code like

simpleDA = simpleRg.getDataArray()
uR = Ubound(theDA)
uC = Ubound(theDA(0))
For r = 0 To uR
  For c = 0 To uC
    simpleDA(r)(c) = myNewValue()
  Next c
Next r
simpleRg.setDataArray(theDA)  

Note: Even simple content can have more than one paragraph (U+000D inserted) and hard linebreaks (U+000A). To get complex formatting you need to work on the single cells addressing them the XText way.

Thanks, the row is added well.