AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Tables In Java

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Fri Jun 16, 2006 5:24 am    Post subject: Tables In Java Reply with quote



Hi,
I was wondering if someone can help me out here please. I am creating a
JTable and displaying it in a window but it gives me Array Out Of
Bounds Exception. The code is as follows

Object[][] data = {
{"j"},
{"j"},
{"j"},
{"j"},
{"j"},
{"j"},{"j"},{"j"},{"j"},{"j"},{"j"} };

String[] columnNames = {"a",
"a","a","a","a","a","a","a","a","a","a"};



JTable table = new JTable(data,columnNames);

JScrollPane scrollPane = new JScrollPane(table);


Thanks a lot for help!!!>
Back to top
Guest






PostPosted: Fri Jun 16, 2006 7:10 am    Post subject: Re: Tables In Java Reply with quote



Thanks you so much. I finally figured it out. I have a problem though.
Lets
say i have names( And other information) seperated by ",". How can i
display them in different fields. I wrote it as follows but it displays

it in one line. Any help will be much appreciated.

Thanks a lot!!!


Object[][] data = { { name, last name, family, series1, series2,
series3,series4, series1, series6, series7, series8} };


String[] columnNames = {"Event name",
"Event type",
"Event series",
"Event eventDate",
"Event eventStartTime","Event eventEndTime","Event
sellStartDate","Event sellEndDate","Event price","Event
performance","Event sponser"};


The names, lastname etc is all display in one line.


Thanks a lot!!!.

azzamqazi (AT) gmail (DOT) com wrote:
Quote:
Hi,
I was wondering if someone can help me out here please. I am creating a
JTable and displaying it in a window but it gives me Array Out Of
Bounds Exception. The code is as follows

Object[][] data = {
{"j"},
{"j"},
{"j"},
{"j"},
{"j"},
{"j"},{"j"},{"j"},{"j"},{"j"},{"j"} };

String[] columnNames = {"a",
"a","a","a","a","a","a","a","a","a","a"};



JTable table = new JTable(data,columnNames);

JScrollPane scrollPane = new JScrollPane(table);


Thanks a lot for help!!!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help 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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.