Table GUI in java?
Wednesday, April 14th, 2010 at
3:45 pm
I have an array of names and telephone numbers. Which GUI in java should I use to display them in a table-like manner? I wanted to have this table used for viewing purposes only.
Possibly related posts: (automatically generated)
- Related posts on java
- Agile Java Project Setup – Part One Trailer | Junit
- James Gosling, Java inventor, leaves Oracle « The JD Edwards Advisor
![]() |
Filed under: Telephone Table FAQ
Like this post? Subscribe to my RSS feed and get loads more!


US $24.99



I don’t know what you mean by GUI. That doesn’t make much sense.
What you could do is run it through a loop that writes html code like
This is close but is nowhere near functional. The essential idea is there my javascript coding just sucks. Clean it up and insert your variable and add it all to a function and you should be good. For javascript resources be sure to check out javascriptkit.com and w3schools.com.
javax.swing.JTable
There is a GUI in java called JTable. It is in swing.
tblName = new javax.swing.JTable();
tblName.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
“Name”, “Phone”, “Address”, “Email”
}
Hi Ashley,
Rob and Daniel are right. You can use JTable for that purpose.You just need to make them not editable for your
purpose.
Here you can find a sample program in JTable
visit : http://javatsp.googlepages.com/
Good Luck
Anand