I have a JButton that is much wider than the text that I inserted into it. I researched this, and I continue to find that I'm using Jbutton.setMargin(new Insets(0,0,0,0)); But that just doesn't work. In addition, setMaximumSize has no effect, although if I also set the minimum size, it changes the size of the button. But I do not want to set the size manually. I just want it to be less wide. What am I missing?
Here is my code for creating the button:
plusminus = new JButton("+"); plusminus.setMargin(new Insets(0,0,0,0));
And here is what it looks like:

Thanks.
source share