Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

Tables In Java

Thread view: 
azzamqazi@gmail.com - 16 Jun 2006 01:25 GMT
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!!!>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.