gpt4 book ai didi

java - GridBagLayout 位置应该在另一个地方?

转载 作者:行者123 更新时间:2023-12-04 19:05:49 25 4
gpt4 key购买 nike

我有以下代码

GridBagConstraints c = new GridBagConstraints();
c.gridx=0;
c.gridy=0;
c.gridwidth=1;
c.gridheight=1;
c.fill = GridBagConstraints.BOTH;
c.insets= new Insets(2,2,2,2);
this.add(pdfUrl,c);
c.gridx=1;
c.weightx=0.1;
c.gridwidth=4;
this.add(pdfUrlin,c);
c.gridx=0;
c.gridwidth=1;
c.gridy=1;
c.weightx=0.0;
this.add(pdfType);

这段代码产生这个 The code produces this

我不明白为什么PDF类型不在下面一行。有人可以帮我吗?

提前致谢

最佳答案

小错误,我想你的意思是:this.add(pdfType, c); 而不是 this.add(pdfType); =)

关于java - GridBagLayout 位置应该在另一个地方?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13533923/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com