去除三个点"...".从JButton? [英] Removing the three dots "..." from a JButton?

查看:91
本文介绍了去除三个点"...".从JButton?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我正在创建一个带有一些小按钮的计算器程序,我希望其中一个按钮上带有"Ans",但是每当我将JButton缩小到50、50时,它将显示三个点. "...",如何删除这些点并显示给定的普通文本?

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?

推荐答案

可能是因为按钮的边距太大.

Probably this because margin of your button is too big.

尝试一下:

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

您还可以关闭边框:

button.setBorder(null);

这篇关于去除三个点"...".从JButton?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆