Well, I surfed the net looking for some help with this, but I'm not trying anything to work. I want all menu texts to focus on the menu buttons. When I use setHorizontalTextPosition(JMenu.CENTER) , there are no changes. In fact, regardless of the constant I use, the menu text remains justified.
Any ideas?
* UPDATE 1
Still out of luck. After reading the JMenu API again, I realized that setHorizontalTextPosition(int) and setVerticalTextPosition(int) set only the text in relation to the icon, and setHorizontalAlignment(int) and setVerticalAlignment(int) set the alignment of the text and icon in JMenu.
Text positioning methods seem to work the way they are advertised using the icon.
The vertical alignment method seems to work with text or an icon or both.
However, the horizontal alignment method does not work at all. Even just using it only by text or icon, or both, nothing changes. I increased the size of the menu to 150x50 and, regardless of the combination, I can not get the text or icon or horizontally horizontally.
source share