NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

how to add rows to the table that i already created

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
udayKIRAN
Posted via mailing list.





PostPosted: Wed Aug 12, 2009 11:48 am    Post subject: how to add rows to the table that i already created Reply with quote

i have a table with two columns..one column has cheskboxes and the other has
strings.i want to add rows dynamically to this table as user enters
data..the data is entered in the form of string in second column and first
column should contain checkbox..how can i do this??
--
View this message in context: http://www.nabble.com/how-to-add-rows-to-the-table-that-i-already-created-tp24934793p24934793.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
Bayless Kirtley
Posted via mailing list.





PostPosted: Wed Aug 12, 2009 2:07 pm    Post subject: how to add rows to the table that i already created Reply with quote

You don't add rows directly to the JTable a run time. They have to be added
to the TableModel which will then automatically update the JTable.

Bayless

----- Original Message -----
From: "udayKIRAN" <address-removed>
To: <address-removed>
Sent: Wednesday, August 12, 2009 6:48 AM
Subject: [nbusers] how to add rows to the table that i already created


Quote:

i have a table with two columns..one column has cheskboxes and the other
has
strings.i want to add rows dynamically to this table as user enters
data..the data is entered in the form of string in second column and first
column should contain checkbox..how can i do this??
--
View this message in context:
http://www.nabble.com/how-to-add-rows-to-the-table-that-i-already-created-tp24934793p24934793.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
Melongo Annabel
Posted via mailing list.





PostPosted: Wed Aug 12, 2009 11:31 pm    Post subject: how to add rows to the table that i already created Reply with quote

I would recommend you use javascript. Here's a good tutorial to dynamically add for elements at runtime: http://www.randomsnippets.com/2008/02/21/how-to-dynamically-add-form-elements-via-javascript/


From: udayKIRAN <address-removed>
To: address-removed
Sent: Wednesday, August 12, 2009 6:48:07 AM
Subject: [nbusers] how to add rows to the table that i already created


i have a table with two columns..one column has cheskboxes and the other has
strings.i want to add rows dynamically to this table as user enters
data..the data is entered in the form of string in second column and first
column should contain checkbox..how can i do this??
--
View this message in context: http://www.nabble.com/how-to-add-rows-to-the-table-that-i-already-created-tp24934793p24934793.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
udayKIRAN
Posted via mailing list.





PostPosted: Thu Aug 13, 2009 11:12 am    Post subject: how to add rows to the table that i already created Reply with quote

is it possible to do it using netbeans...as i have to code it in java
Quote:
Melongo Annabel wrote:
I would recommend you use javascript. Here's a good tutorial to dynamically add for elements at runtime: http://www.randomsnippets.com/2008/02/21/how-to-dynamically-add-form-elements-via-javascript/ ________________________________ From: udayKIRAN To: address-removed Sent: Wednesday, August 12, 2009 6:48:07 AM Subject: [nbusers] how to add rows to the table that i already created i have a table with two columns..one column has cheskboxes and the other has strings.i want to add rows dynamically to this table as user enters data..the data is entered in the form of string in second column and first column should contain checkbox..how can i do this?? -- View this message in context: http://www.nabble.com/how-to-add-rows-to-the-table-that-i-already-created-tp24934793p24934793.html Sent from the Netbeans IDE Users mailing list archive at Nabble.com.


View this message in context: Re: how to add rows to the table that i already created
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
Franz
Posted via mailing list.





PostPosted: Thu Aug 13, 2009 7:00 pm    Post subject: how to add rows to the table that i already created Reply with quote

udayKIRAN schrieb:
Quote:
i have a table with two columns..one column has cheskboxes and the other has
strings.i want to add rows dynamically to this table as user enters
data..the data is entered in the form of string in second column and first
column should contain checkbox..how can i do this??

Get the model from your table and modify the model.
If you haven't set the model explicitly, you'll have to cast the model
(most likely to a DefaultTableModel) before using it.

Regards
Franz
PS: is there a mailinglist FAQ? I think, I've read this kind of question
several times in the last weeks.
Back to top
Melongo Annabel
Posted via mailing list.





PostPosted: Fri Aug 14, 2009 1:56 am    Post subject: how to add rows to the table that i already created Reply with quote

Is is web application or GUI application?


From: udayKIRAN <address-removed>
To: address-removed
Sent: Thursday, August 13, 2009 6:12:01 AM
Subject: Re: [nbusers] how to add rows to the table that i already created

is it possible to do it using netbeans...as i have to code it in java
Quote:
Melongo Annabel wrote:
I would recommend you use javascript. Here's a good tutorial to dynamically add for elements at runtime: http://www.randomsnippets.com/2008/02/21/how-to-dynamically-add-form-elements-via-javascript/ ________________________________ From: udayKIRAN To: address-removed Sent: Wednesday, August 12, 2009 6:48:07 AM Subject: [nbusers] how to add rows to the table that i already created i have a table with two columns..one column has cheskboxes and the other has strings.i want to add rows dynamically to this table as user enters data..the data is entered in the form of string in second column and first column should contain checkbox..how can i do this?? -- View this message in context: http://www.nabble.com/how-to-add-rows-to-the-table-that-i-already-created-tp24934793p24934793.html Sent from the Netbeans IDE Users mailing list archive at Nabble.com.


View this message in context: Re: how to add rows to the table that i already created
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
udayKIRAN
Posted via mailing list.





PostPosted: Fri Aug 14, 2009 10:28 am    Post subject: how to add rows to the table that i already created Reply with quote

thanks..got it

Franz Graf wrote:
Quote:

udayKIRAN schrieb:
Quote:
i have a table with two columns..one column has cheskboxes and the other
has
strings.i want to add rows dynamically to this table as user enters
data..the data is entered in the form of string in second column and
first
column should contain checkbox..how can i do this??

Get the model from your table and modify the model.
If you haven't set the model explicitly, you'll have to cast the model
(most likely to a DefaultTableModel) before using it.

Regards
Franz
PS: is there a mailinglist FAQ? I think, I've read this kind of question
several times in the last weeks.



--
View this message in context: http://www.nabble.com/how-to-add-rows-to-the-table-that-i-already-created-tp24934793p24969557.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
Glaursen



Joined: 20 Aug 2009
Posts: 8
Location: Phoenix

PostPosted: Thu Aug 20, 2009 4:23 pm    Post subject: Reply with quote

I'm trying to do the same thing. Can you please provide a code snippet to show what you are describing below? I have a Table1 component and want to know how to get my model from the table.

Quote:
Get the model from your table and modify the model.
If you haven't set the model explicitly, you'll have to cast the model
(most likely to a DefaultTableModel) before using it.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo