使JFrame的所有组件适合窗口的实际大小 [英] Fit all components from JFrame to actual size of window

查看:147
本文介绍了使JFrame的所有组件适合窗口的实际大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用NetBeans.如何将窗口中的所有组件调整为窗口的实际大小?现在,当我的窗口为800x600并放大时,所有组件的大小都相同.更改打开的应用程序窗口的大小时,我想更改组件的大小.

I'm using NetBeans. How I can make all components from my window to resize to actual size of the window? Now when my window is 800x600 and I make it larger, size of all components are the same. I would like to change size of my components when I change size of open application window.

我试图在互联网上寻找答案,但是找不到解决我问题的好方法.

I tried to search for answer on the internet but I couldn't find good answer to my problem.

推荐答案

我试图在互联网上寻找答案,但是找不到解决我问题的好方法.

I tried to search for answer on the internet but I couldn't find good answer to my problem.

我很难相信.

论坛中几乎所有其他问题都与布局组件有关.标准答案是使用布局管理器.阅读有关使用布局管理器的Swing教程中的部分,以了解更多信息.信息.我们无法提供具体信息,因为我们不知道您的GUI是什么样子.

Almost every other question in the forums is about laying out components. The standard answer is to use a Layout Manager. Read the section from the Swing tutorial on Using Layout Managers for more information. We can't give specific information because we have no idea what your GUI looks like.

这篇关于使JFrame的所有组件适合窗口的实际大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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