• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

JMenuItem centering

Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've attempting to center JMenuItems in a JPopupMenu (they only have text, no icons), and I try to use the setHorizontalAlignment(SwingConstants.CENTER) method. However, the menu items end up being "centered", but they are too far to the right of the popup menu as if the popup menu should have been wider.
Anyone have any suggestions on this?
Also, as I add more and more items to the JPopupMenu, there seems to be a big blank space after the last item that gets larger as I add more items.
[ March 09, 2005: Message edited by: Eric Chang ]
get schwifty. tiny ad:
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic