hi,
> jp.add(jsp);// For your easy reference,I am gettig run time error in
> this line
> c.add(jp);
what's this *jp* thing.
I think you only need to add jsp to contentpane. that's c.add(jp);
just delete the line before it (the line you get error)
Arun.K.R
[
!Atharvan!333!
{ Man can be Destroyed but cannot be Defeated. }
On Mar 2, 10:32 am, sriramulu chittajallu
<[email protected]> wrote:
> Hi friends,
>
> I need to work with JTable to display the table on the frame
> dynamically. But When i am displaying that, I am getting runtime error at
> the line "jp.add(jsp)". I did this program in NetBeans 5.0. So kindly tell
> me the sequence of steps to display the table dynamically on net beans 5.0.
>
> My requirement is to display the two dimensional string as content in the
> table.
>
> Following is the program I did.
>
> private void btnOkActionPerformed(java.awt.event.ActionEvent evt) {
> String
> st[][]={{"a","b","d","d"},{"c","d","e","e"},{"e","f","s","t"},{"j","y","t","u"}};
> String st1[]={"x","y","z","s"};
> c=getContentPane();
> dft=new DefaultTableModel();
>
> dft.setDataVector(st,st1);
> jt=new JTable(dft);
> JScrollPane jsp=new JScrollPane(jt);
> // jt.setCellSelectionEnabled(true);
> jp.add(jsp);// For your easy reference,I am gettig run time error in
> this line
> c.add(jp);
>
> }
>
> Otherwise, suggest me another way to display the table that need to take the
> data from the two dimensinal arry string as conent and one dimensional
> string as column heads.
>
> I hope that i get response soon.
>
> Thank u in advance.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---