how to fetch cell value from jtable

hi all,i m working on jtable my problemis that suppose i right click on any cell of the jtable then a new pop-up window is generated i needs to pick the value of the particular cell in the pop-up menu how can i do that plz sujjest me.Thanks in advance
[272 byte] By [jamesgoslina] at [2007-11-27 8:28:48]
# 1
Hiyou can use ListSelectionListener to select when the user clicks a row
kulkarni_asha at 2007-7-12 20:18:53 > top of Java-index,Desktop,Core GUI APIs...
# 2
any other way other than this plz sujjest me.
jamesgoslina at 2007-7-12 20:18:53 > top of Java-index,Desktop,Core GUI APIs...
# 3

Integer[][] data = new Integer[][] {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};

String[] columns = new String[] {"First", "Second", "Third"};

final JTable table = new JTable(data, columns);

table.addMouseListener(new MouseAdapter() {

@Override

public void mouseClicked(MouseEvent e) {

int row = table.rowAtPoint(e.getPoint());

int col = table.columnAtPoint(e.getPoint());

int realCol = table.convertColumnIndexToModel(col);

Object value = table.getValueAt(row, realCol);

System.out.println(value);

}

});

dwga at 2007-7-12 20:18:53 > top of Java-index,Desktop,Core GUI APIs...
# 4

I was about to help and give you a simple solution, but then I realized you have never appreciated the help you have received in the past so I won't bother wasting my time this time:

http://forum.java.sun.com/thread.jspa?threadID=5153697

http://forum.java.sun.com/thread.jspa?threadID=5178175

http://forum.java.sun.com/thread.jspa?threadID=5162875

http://forum.java.sun.com/thread.jspa?threadID=5156296

http://forum.java.sun.com/thread.jspa?threadID=5155648

just to list a couple...

camickra at 2007-7-12 20:18:53 > top of Java-index,Desktop,Core GUI APIs...
# 5
y r u angry man with me i really appreciate all the helps provided by all the forum members if i could not have git solution y could i have wasted time here in posting my problem so if u r angry plz do forgive me.
jamesgoslina at 2007-7-12 20:18:53 > top of Java-index,Desktop,Core GUI APIs...
# 6
Apparently you still haven't learned anything. You got a solution yet you still haven't thanked the person for the help given.
camickra at 2007-7-12 20:18:53 > top of Java-index,Desktop,Core GUI APIs...