wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes setBorder not working on JTable ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "setBorder not working on JTable ?" Watch "setBorder not working on JTable ?" New topic
Author

setBorder not working on JTable ?

achana chan
Ranch Hand

Joined: Jul 29, 2002
Posts: 277
Hi. I have a JTable and I would like to experiment with the border thickness and color, like this:

Java throws compile time error:

cannot resolve symbol
variable BorderFactory(BorderFactory.createLineBorder(Color.RED,1));
.......................^

TIA :-)


humanum errare est.
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
add :
import javax.swing.BorderFactory
D.
achana chan
Ranch Hand

Joined: Jul 29, 2002
Posts: 277
Hmm, that sets the border around the whole table rather than the cells.
Do I assume right I have to use a cell renderer to have the borders set for all cells as well ?
TIA :-)
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
have a look at JTable.setGridColor()
D.
achana chan
Ranch Hand

Joined: Jul 29, 2002
Posts: 277
All is fine :-)
Thanks for taking time to look at my issue.
Memo to myself : read doco again
http://builder.com.com/5100-6370-5054206.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setBorder not working on JTable ?
 
Similar Threads
jtable
JTable
jtable not displayed
Detecting Row Changes on a JTable