473,395 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Jtable Problem

hallo gyus i have a problem

i create a table, and populate its data through the pojo,now this i am select one row and this data will be display in another panel , then i write a class which will
implement ListSelectionListener,i am just showing you the code sample, this is an inner class

class AddaxFMSBodySelectionListener implements ListSelectionListener {

int[] selRows;
Object value;

public void valueChanged(ListSelectionEvent listSelectionEvent) {
boolean adjust = listSelectionEvent.getValueIsAdjusting();
if (!adjust) {
selRows = table.getSelectedRows();
int selections[] = table.getSelectedRows();
int selectedValues[] = table.getSelectedColumns();
// value = table.getValueAt(selRows[0], i);
if (selRows.length > 0) {
for (int i = 0; i < 4; i++) {
// get Table data
TableModel model = table.getModel();
value = model.getValueAt(selRows[0], i);
/*Here i am finding the single row value*/
/**
String name = AddaxFMSDataItem.class.cast(value).getName();
**/
//but when i try to find out only single value of the cell then i will got stuck
System.out.println("Selection : " + value);
}
System.out.println();
}

If any body got any idea then help me.
Apr 6 '08 #1
1 1252
JosAH
11,448 Expert 8TB
Can you please rephrase your question because I don't understand what the trouble is.

kind regards,

Jos
Apr 6 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ben Munday | last post by:
Hi all, I have a problem with a Checkbox in a JTable. When i add the Checkbox into the JTable it displays the String representation of the Checkbox, which is not what i want. So, i created a...
0
by: sivaprasad06 | last post by:
Hi, I have a editable combo box editor as a cell editor for JTable. I want use only key board to enter data into jtable. so i am using ALT+Down comobination for making cell editiable in the...
0
by: nuria | last post by:
hi, I have an editable JTable, when you are editing it and press F8 shows a dialog and then go again to the JTable window but the focus goes to a JtextField component, go with the tab for the...
7
blazedaces
by: blazedaces | last post by:
Hi guys, what I'm I have is a jtable with boolean variables in the first column and text in the next two (checkboxes). I want my tableChanged method to make it so when I check one of the checkboxes...
1
by: Gimzo | last post by:
Hi, I'm trying to create a button that opens a new window for setting up a whole crapload of constants for an analysis program. For this, I have a JButton. The actionPerformed-method activates...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.