Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

JTable in Swing(Java)

hi
Good Evening
I am very new to this forum and also I am very new to java.Will you please
help me to put the records which are in my ResultSet rs into a JTable.For
last few days i try with this and i could not get the proper way.Because I a m
new to java I can not get it from java related sites and documentations.So I send the question to you.
Mo code is started like this
Statement s = toconnect.con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE );
String tofirst="SELECT * from [Student-File]";
ResultSet rs;
rs = s.executeQuery(tofirst);
A connection is already opened to do this.

So please help me to follow.
[740 byte] By [meenakshi] at [2007-11-11 7:45:41]
# 1 Re: JTable in Swing(Java)
I think you will find this link ( http://java.sun.com/docs/books/tutorial/uiswing/components/table.html) useful.
destin at 2007-11-11 22:37:26 >
# 2 Re: JTable in Swing(Java)
You need to use the result set to build a TableModel which will back the JTable.

See: http://www.oreillynet.com/pub/a/oreilly/java/news/javaex_1000.html
nspils at 2007-11-11 22:38:27 >
# 3 Re: JTable in Swing(Java)
hi,
Good Evening
Thank you so much for your reply.
Now I am trying with your reply.From this site I got clear idea about JTable but I cannot proceed to put the records in to JTable from the MS-Access table.But I am trying.
Thank you so much.Sorry for my late reply.
meenakshi at 2007-11-11 22:39:30 >
# 4 Re: JTable in Swing(Java)
hi,
Good Evening,
Thank you so much for your reply.
I am trying with the site given by you.
I am in a full hope that I can solve it by using this site
Thank you and sorry for my late reply.
meenakshi at 2007-11-11 22:41:26 >