B4J Question TreeView Corner Radius

Cableguy

Expert
Licensed User
Longtime User
Hi guys,

Here I am again with a NQ (Noob Question)
TreeView has, as many views do, a corner radius property.
My issue is the value seems to only be set to the "base panel" of this ("custom view"?)

1694939532650.png

So... what is the view I need to address to set the correct corner radius??
 
Solution
Hi Cableguy,
Is this something like that you want?
TreeviewRoundCorner.png

The treeview is transparent and I put a panel underneath with rounded edges. But I no longer have the scroll bar.

BlueVision

Active Member
Licensed User
Longtime User
Lol. Funny that it's not just me who has this problem. However, I have given up trying to solve this problem. But since the proportions in my views usually don't change dynamically, I went the easiest way. I made the radius of the rounded corners a little smaller and then centred the element above it. Within certain limits, this even works with the Designer (calculation of width and height of the underlying element and corresponding centric positioning of the element above). However, if the radii of the corners are too large, this no longer works.
As in your picture, it just looks ugly. It simply disturbs the visual aesthetics of the view.
It would be helpful if a 'childview' would automatically adapt to the rounded corners of the 'parentview' below.

Screenshot_Sample.jpg
 
Last edited:
Upvote 0

zed

Active Member
Licensed User
Hi Cableguy,
Is this something like that you want?
TreeviewRoundCorner.png

The treeview is transparent and I put a panel underneath with rounded edges. But I no longer have the scroll bar.
 
Upvote 0
Solution

Cableguy

Expert
Licensed User
Longtime User
AAAAARRRRRRGGGGGG

It works perfect in the designer preview, but compilated, it doesn't look quite the same!
1694943235190.png


HUMMMMMM..... that is just the treeview focus! Need to keep an eye on that!
 
Last edited:
Upvote 0

stevel05

Expert
Licensed User
Longtime User
What is actually causing the issue are the top and bottom treecells contained in the treeview.

1694955461604.png

View from Scenic View


If you set the ExtraCss on the treeview something like: -fx-padding:5 20 5 20; (or whatever suits your radius) then the contained cells are no longer wide enough to cause the issue.

1694955591359.png




Whether that is what you want is another matter as you will get bigger left and right margins.
 
Last edited:
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Yes, it all depends on the Radius you choose. Trying different values for the padding should get somewhere close as a compromise and not lose too much left and right.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
BTW, that is CSS documentation for a very old version of JavaFX. Look for one that matches the version of JavaFX you are using. not much changes, but you never know. : JavaFX14
 
  • Like
Reactions: zed
Upvote 0
Top