*
The moose likes Swing / AWT / SWT and the fly likes JMenuItem.setMargin Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JMenuItem.setMargin" Watch "JMenuItem.setMargin" New topic
Author

JMenuItem.setMargin

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I have been trying to set the margin of my JMenuItems to spread them out a little so they aren't so crammed together. Here is how I thought was the right way
Insets s = new Insets(5, 5, 5, 5);
JMenuItem b = new JMenuItem("b");
b.setMargin(s);
Anyway, it is not working. Could someone correct my problem?
Thanks

------------------
Happy Coding,
Gregg Bolinger


GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Ok, I have started to get this figured out on my own. But there is a problem. Here is my code.

I thought that since I only grabbed the insets from the New JMenuItem that it would only affect that Component, but it has affected the entire JMenuBar. Anyone know what is going on here?
BTW - This class is called from another class that extends JFrame and creates a JDesktopPane with JInternalFrames. I just didn't want all this mess to be in with my main() file.
------------------
Happy Coding,
Gregg Bolinger
[This message has been edited by Gregg Bolinger (edited October 31, 2001).]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Ok, I am the only one responding to myself. I REALLY need some help here. If anyone has any information, please post.
Thank you

------------------
Happy Coding,
Gregg Bolinger
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMenuItem.setMargin
 
Similar Threads
How to use ItemStateChanged()?
This should be simple
how does GridBagConstraints accesses the insets variable, please help ??
How to test Junit for the class
Problem in adding Jpanel to JFrame (Updated)