18

I am trying to create a schedule interface within javafx 2+, and I am having trouble getting the TableView to contain TableCells that look like conjoined components.

The first thing that I tried was to use background colors and borders, however, I cannot get the borders to differ between the top and bottom.

-fx-border-width: 1px, 0px, 0px, 0px; for top

-fx-border-width: 0px, 0px, 1px, 0px; for the bottom

Ideally I would be able to span columns or rows, but I understand that it does not fit the model of the control. Any help is greatly appreciated.

Sergey Grinev
  • 34,078
  • 10
  • 128
  • 141
user1352550
  • 181
  • 1
  • 1
  • 3

1 Answers1

39

Just remove commas from your code. E.g.:

-fx-border-width: 1 2 3 4; -fx-border-color: red blue green yellow;
Sergey Grinev
  • 34,078
  • 10
  • 128
  • 141
  • 14
    and you can also try this -fx-border-style: hidden hidden solid hidden; if you want to hide some border side – Mubasher Oct 02 '14 at 10:19
  • Why do I get unknown property -fx-border-width with Java FX8 in Eclipse? It also does not work. – Andrew S Mar 24 '16 at 16:57
  • @AndrewS my mind reader is on vacation, please post your code as a separate question :) – Sergey Grinev Mar 24 '16 at 17:12
  • No no, I'm sure the answer is more fundamental than that. It seems not setting a color to the border causes it not to apply. So if one want's a margin a color must be specified. Even setting a transparent color causes odd behavior with TextFields. – Andrew S Mar 24 '16 at 17:38