javafx 如何让ComboBox铺满GridPane的整列 20

例如下图:现在“位置”和“有无边框”我是放在一个GridPane中,我希望“有无边框”对应的的ComboBox和上面的“位置”对应的TextField一样充满整列... 例如下图:现在“位置”和“有无边框”我是放在一个GridPane中,我希望“有无边框”对应的的ComboBox和上面的“位置”对应的TextField一样充满整列 展开
 我来答
百度网友12ee0fd
2014-05-23 · TA获得超过4.7万个赞
知道大有可为答主
回答量:1.1万
采纳率:66%
帮助的人:2092万
展开全部
试试GridPane的这个方法:
public static void setHgrow(Node child,
Priority value)

Sets the horizontal grow priority for the child when contained by a gridpane.
If set, the gridpane will use the priority to allocate the child additional
horizontal space if the gridpane is resized larger than it's preferred width.
Setting the value to null will remove the constraint.

Parameters:
child - the child of a gridpane
value - the horizontal grow priority for the child
追问
这个方法我尝试过了,用在TextFiled上面有用,但是用在ComboBox上面是无效的。。
小baboo
2014-05-23
知道答主
回答量:24
采纳率:0%
帮助的人:8.4万
展开全部
给有无边框 加 width 并且赋值
追问
你的意思是给GridPane加上边框还是给ComboBox加上边框?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式