Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 737
Stan Avatar asked Apr 27 '11 17:04

Stan


People also ask

How to remove all dots from a string in JavaScript?

By replacing all dots with an empty string, we practically remove all dots in the string. The replace method does not change the original string, it returns a new string with the matches replaced. Strings are immutable in JavaScript.

How to use the 3 dots in JavaScript function calls?

We can use the 3 dots in JavaScript function calls to convert an array into a set of arguments for a function. Let’s look at an example. Below, our array is converted into the values for x, y, z and a.

What is JButton in Java?

Java JButton. The JButton class is used to create a labeled button that has platform independent implementation. The application result in some action when the button is pushed. It inherits AbstractButton class. Let's see the declaration for javax.swing.JButton class.

Is there an official list of all the dots on menu?

Nothing is official. 3 horizontal dots - (horizontal) ellipsis, meatballs menu 3 vertical dots - vertical ellipsis, kebab, dango menu 9 dots - bento, waffle menu 3 horizontal lines - hamburger menu Share Improve this answer


2 Answers

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);
like image 200
lukastymo Avatar answered Sep 28 '22 08:09

lukastymo


Don't set the preferred size of the button. Use the preferred size of the button and let the layout manager layout the components. The preferred size ensures all the text will be displayed properly on different Look and Feels.

like image 24
camickr Avatar answered Sep 28 '22 07:09

camickr