[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

Getting data from a particular cell in a table

I'm retrieving data from a remote Oracle database.  Is there a method or something else that gets the contents off a cell of a highlighted row in a table?  If it helps, I'm using Borland JBuilder 3. Thanks.
0
Mero
Asked:
Mero
1 Solution
 
sgomsCommented:
If it is JTable then how abt,

getValueAt(table.getSelectedRow(), table.getSelectedColumn());
this will return the Object in that cell.
0
 
vivexpCommented:
Hi,

If u r using DefaultTableModel then,

 String[] s={"A","B","C","D","E","F","G","H","I","J","K"};//s is col //names,50 is no. of rows.

  DefaultTableModel dtm=new DefaultTableModel(s,50);
  JTable jT = new JTable(dtm);

To access a cell in the table use
dtm.getValueAt(jT.getSelectedRow(), jT.getSelectedColumn());


Try out ....
Bye
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now