How do I set the font size of the text on a swing jButton to the maximum size who fits the jButton

I've got a jPanel with a jButton, and the user can define the size of the jPanel when launching the application using parameters, the jButton sizes according to the jPanel. The problem is when I use a fixed font and the Panel is large, then the font looks very small, and vica versa. So the font size should always be the maximum font size who fits in the button.
This seems like the basic problem when you let users specify the size of a JPanel or other container. That is what Layouts are for. If it is too big for the current view, throw it in a JScrollPane.

以上就是How do I set the font size of the text on a swing jButton to the maximum size who fits the jButton的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏