Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
416 views
in Technique[技术] by (71.8m points)

java - Removing the three dots "..." from a JButton?

Hey, I am creating a calculator program, with some small buttons, I want one of the buttons to have "Ans" on them, but whenever I make the JButton smaller then 50, 50, it will show three dots. "...", how can I remove these dots and show the normal text given?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Probably this because margin of your button is too big.

Try this:

myButton.setMargin(new Insets(0, 0, 0, 0));

You can also turn off border:

button.setBorder(null);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...