dcsimg
How to Add horizontal spaces in a JCheckBoxMenuItem
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   hardeep_singh
Posted On:   Wednesday, May 3, 2006 07:04 AM

I have a menu with a number of JCheckBoxMenuItem menuItems
I want that some of these items should be horizontally
spaced from the previous ones but I was unable to find
any procedure for this.

I have tried setX(), setY()


menuItem.setLocation(menuItem.getX() + 60 ,menuItem.getY() + 40);
menuItem.setX(40);
menuItem.updateUI();
menuItem.repaint();
menu.repaint();
menu.updateUI();


Can someone tell me the procedure to do this

Re: How to Add horizontal spaces in a JCheckBoxMenuItem

Posted By:   Robert_Lybarger  
Posted On:   Wednesday, May 3, 2006 07:44 AM

I don't think I have an answer for that, but I (and to be sure, other people) am curious why you want to do this The end effect is that it would either:

  • not get noticed by technically illiterate people (Years at this, and I am still amazed at how some people do not *see* various UI hints we devs give them.)

  • look very strange and non-standard to casual users

  • look like a violation of a user interface guidelines/best practices to advanced users (who could, granted, deal with it, but who would still be irritated by it)


If you are wanting to group related items and set them apart, visually, from other items, then this sort of thing is usually done in a second-level menu that "flies out" from the first-level menu.
About | Sitemap | Contact