This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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


Win a copy of Head First Android this week in the Android forum!
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
 
 
subject: setBorder not working on JTable ?
 
It's not a secret anymore!