java的swing中如何设置jbutton都一样大呢
这三个按钮不一样大我如何设一样大呢?这是我的代码add(checkConnection,newConstraints(0,0,1,1,1,1).setAnchor(Con...
这三个按钮不一样大 我如何设一样大呢?
这是我的代码
add(checkConnection,new Constraints(0,0,1,1,1,1).setAnchor(Constraints.WEST));
这是Constraints类的代码
public class Constraints extends GridBagConstraints {
public Constraints(int gridx,int gridy,int gridwidth,int gridheight,int weightx,int weighty){
this.gridx=gridx;
this.gridy=gridy;
this.gridwidth=gridwidth;
this.gridheight=gridheight;
this.weightx=weightx;
this.weighty=weighty;
}
}
还有 右边是一个文本框 但是现在看不见 我如何让这个文本框变成白色的呢
用的是gridbaglayout 展开
这是我的代码
add(checkConnection,new Constraints(0,0,1,1,1,1).setAnchor(Constraints.WEST));
这是Constraints类的代码
public class Constraints extends GridBagConstraints {
public Constraints(int gridx,int gridy,int gridwidth,int gridheight,int weightx,int weighty){
this.gridx=gridx;
this.gridy=gridy;
this.gridwidth=gridwidth;
this.gridheight=gridheight;
this.weightx=weightx;
this.weighty=weighty;
}
}
还有 右边是一个文本框 但是现在看不见 我如何让这个文本框变成白色的呢
用的是gridbaglayout 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询