0

I'm having trouble centering and right aligning table headers in scala swing.

I can align text for the other data rows (by overriding the rendererComponent method in scala.swing.Table class).

The suggested way in java swing is to set a custom cellrenderer (e.g. Align the values of the cells in JTable?) to align cells, however this does not work in scala swing table...

Any help is appreciated

thanks

Community
  • 1
  • 1
Dzhu
  • 4,311
  • 5
  • 36
  • 48

1 Answers1

0

Most Scala-Swing components has peer property which gives you access to the underlying Java's Swing component. So I believe, that you just need get table.peer and then use solution you mentioned. More info you can find in SalaDoc:

http://www.scala-lang.org/api/current/scala/swing/Table.html#peer:JTable

Hope this helps.

tenshi
  • 26,268
  • 8
  • 76
  • 90