aspose file tools*
The moose likes Beginning Java and the fly likes adding whitespace jtable cell Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "adding whitespace jtable cell" Watch "adding whitespace jtable cell" New topic
Author

adding whitespace jtable cell

abracadabration abracadabration
Greenhorn

Joined: May 12, 2006
Posts: 2
Is there a way to add whitespace to jtable cell using setValueAt(), so that all the datas in jtable are arranged in a decorative manner?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42285
    
  64
Hello "abracadabration"-

Welcome to JavaRanch.

On your way in you may have missed that JavaRanch has a policy on display names, and yours does not comply with it; specifically, a first name and a last name are required. Please adjust it accordingly, which you can do right here. Thanks for your prompt attention to this matter.


Ping & DNS - my free Android networking tools app
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Originally posted by abracadabration abracadabration:
Is there a way to add whitespace to jtable cell using setValueAt(), so that all the datas in jtable are arranged in a decorative manner?


No. SetValueAt is for storing data in the JTable's DataModel. Methods that deal with the appearance of the table's cells include:

setIntercellSpacing
setRowHeight
setRowMargin

You can also configure the width of a column by getting that column's TableColumn object and calling its methods:

setMinWidth
setMaxWidth
setPreferredWidth

If you haven't already, you should study the tutorial: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

And a tip: GUI questions should go to the GUI forum: Swing / AWT / SWT / JFace


There is no emoticon for what I am feeling!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: adding whitespace jtable cell