+ Follow
since Mar 05, 2004
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vijay

I have got rid of the bug in ur code. The following code should compile.

20 years ago
It would be *a lot* easier just to put a string above the table headers...
is there any really special reason to put it below the headers?
Thanks for ur response. Yes, a JLabel would just suffice in ur case.
But I need to display an info like " No records are available for this
table" when there are no rows. Now, again I can do a setPreferredViewPortSize() of the JTable and add a JLabel under the JTable.
But I have atleast 50 tables in my code. And I dont want to goto every place and add those lines of code. Instead I want to generalize and put
my string info in my "generalized" MyJTable or MyHeaderCellRenderer,etc
(which extends JTable, TableCellRenderer,etc)
well, after some googling, I was able to get some hint. Can someone ,now, have a look into it and help me out.
This one is for cell spanning:
This one can be referred for placing the String in Header ( I prefer it to be here)
Hoping for a reply (suggestion/code snippet) from JGurus!. Thanks.
20 years ago
use TableModel. A table gets its data from an object that implements the TableModel interface.
20 years ago
Can somebody give me an idea of how to go about creating a table like shown below:
| column1 | column2 | column 3| Column4 |
| **** This row has some string info in it ***|
| value1 | value2 | value3 | value4 |
| valuei | value j | valuek | valuez |

I need to add that line of text in between the header and the content.
How to go about it ? Should that line be a part of JTableHeader or
should I need to span over the cells of the content ?
20 years ago
I have a JTable whose values gets filled only dynamically.
At times, when the table is empty, I want to show a message like
"no records found" just under the table header.
Just like how in windows machine, when you make a search and if it doesnt
return any records, it prints "Search is complete. There are no results to display"
(stretching many columns) under the table header. I considered using JLabel
(as shown below) but there is always some space b/w the two components.
Let me know ur suggestions. Until then, lemme try out other Layout managers.
Just a code snippet:

(N. Pruett - fixed page-widening code.)
[ March 08, 2004: Message edited by: Nathan Pruett ]
20 years ago