In rft, how does one obtain all data in jtable?
Public
Void
Testmain (object []
ARGs)
{
// Start classics Java application
Startapp
(
"Classicsjavaa"
);
// Navigate to existing order Grid
JMB (). Click (Atpath
(
"Order"
));
JMB (). Click (Atpath
(
"Order-> View
Existing order status ..."
));
// Frame: view order status
Namecombob (). Click ();
Namecombob (). Click (Attext
(
"Claire
STRATUS"
));
OK (). Click ();
// Frame: view existing orders
Existingtable (). Click (Atpoint
(172,92 ));
// Get the data for the table
Itestdatatable
Ordertable = (itestdatatable) existingtable (). gettestdata (
"Contents"
);
// Display the available data types for the grid, total
Rows and columns.
System.
Out
. Println (
"Available
Data Types :"
+ Existingtable (). gettestdatatypes
());
System.
Out
. Println (
"Total rows in
Table :"
+ Ordertable. getrowcount ());
System.
Out
. Println (
"Total cols in
Table :"
+ Ordertable. getcolumncount ());
// Cycle through all rows
For
(
Int
Row = 0; row <
Ordertable. getrowcount (); ++ row)
{
// Cycle through all columns
For
(
Int
Col = 0; Col <
Ordertable. getcolumncount (); ++ col)
{
// Print out values
Of cells at (row, Col
) Coordinates
System.
Out
. Println (
"Row"
+ Row +
","
+ Ordertable. getcolumnheader
(COL) +
":"
+ Ordertable. getcell
(Row, col ));
}
}
// Close the frame
Close (). Click ();
// Frame: classicscd
Classicsjava (
Any
,
May_exit
). Close ();
}
}
Console output:
Available data types: {contents = table content, visible contents = visible table content,
Selected = selected table cell, visible selected = selected visible table cell}
Total rows in table: 1
Total cols in table: 7
Row 0, order ID: 7
Row 0, order date:
3/11/98
Row 0, status: Order initiated
Row 0, Composer: Bach
Row 0, composition:
Brandenburg
Concertos nos. 1
& 3
Row 0, quantity: 5
Row 0, total: 84.9500