• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setBorder not working on JTable ?

 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 :-)
 
Don Kiddick
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
add :
import javax.swing.BorderFactory
D.
 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have a look at JTable.setGridColor()
D.
 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic