folks.
Here’s the problem. Let’s say I have three items on my menu. I want the first one to be invisible (like transparent) but at the same time consumes space. And the second and third to be display normally.
Thanks
EDITED:
I have three items on the menu. I have menu arranged vertically, so like this:
Menu:
Item1
Item2
Item3
Now, I want the first item to be invisible (still there consuming space, but is not visible to the eye). So it will look like this now:
Menu:
Item2
Item3
You see, it’s still there but not any part of it is visible. (background color set to transparent, no text, etc.)
I think menu items only have two options – setVisible(false) which removes it (doesn’t take up space), or setEnabled(false), which grays out the option but it’s still visible.
If you really want to have it take up space, perhaps you can try a combination of setTitle(“”) with setEnabled(false) on the menuitem which you want to make hidden but still consume space.
e.g.,
This way, the item will be there, but it will be disabled so that clicking it will not trigger its action.