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!!!>
azzamqazi@gmail.com - 16 Jun 2006 03:25 GMT
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!!!.
> Hi,
> I was wondering if someone can help me out here please. I am creating a
[quoted text clipped - 17 lines]
>
> Thanks a lot for help!!!>
Henry - 16 Jun 2006 04:25 GMT
> Thanks you so much. I finally figured it out. I have a problem though.
> Lets
[quoted text clipped - 19 lines]
>
> Thanks a lot!!!.
Have a look at the Java Tutorial:
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html.
--
Rhino
> > Hi,
> > I was wondering if someone can help me out here please. I am creating a
[quoted text clipped - 17 lines]
> >
> > Thanks a lot for help!!!>
azzamqazi@gmail.com - 16 Jun 2006 04:27 GMT
yeah i took a loook at this but cant figure out what i am doing wrong.
> > Thanks you so much. I finally figured it out. I have a problem though.
> > Lets
[quoted text clipped - 47 lines]
> > >
> > > Thanks a lot for help!!!>
Henry - 16 Jun 2006 14:08 GMT
> yeah i took a loook at this but cant figure out what i am doing wrong.
The code in your post looks okay so have a look at the code that ISN'T
in your post and compare it to the article from the Java Tutorial.
Somewhere, there has to be a difference.
If you still don't see a difference, run your code in a debugger and
step through it one statement at a time, carefully watching all of the
variables to ensure each is behaving exactly as it should. That should
reveal your problem.
Most IDEs have integrated debuggers and these are wonderful tools for
finding problems. If you aren't using an IDE, maybe it is time to
consider using one. There are lots of good free ones. I'm quite fond of
Eclipse, as are many others on this newsgroup, and its debugger would
help you find your problem quite quickly. There's a learning curve
involved in learning to use your IDE and its debugger but it can pay
for itself many times over in speeding up software development. I
wouldn't typically recommend an IDE to someone who is just starting to
learn Java but, once you've written your first few play programs and
are ready to do some serious development, an IDE can really help your
productivity, especially for finding problems.
--
Henry
> > > Thanks you so much. I finally figured it out. I have a problem though.
> > > Lets
[quoted text clipped - 47 lines]
> > > >
> > > > Thanks a lot for help!!!>