什么是setBounds以及如何使用它? [英] What is setBounds and how do I use it?

查看:384
本文介绍了什么是setBounds以及如何使用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在setBounds上找不到任何东西,它的用途是什么,或者它的功能实际上是什么。有人可以让我知道吗?非常感谢!

I cannot find anything on setBounds, what it is for, or what its function actually is. Could someone clear me up on this? Thanks so much!

推荐答案

你可以使用 setBounds(x,y,width,height)如果将布局设置为 null ,则指定GUI组件的位置和大小。然后(x,y)是该组件左上角的坐标。

You can use setBounds(x, y, width, height) to specify the position and size of a GUI component if you set the layout to null. Then (x, y) is the coordinate of the upper-left corner of that component.

这篇关于什么是setBounds以及如何使用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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