this.node = node;
textLabel.setText(node.getName());
BorderLayout borderLayout = new BorderLayout();
borderLayout.setHorizontalSpacing(10); //孩子之间的HorizontalSpacing
label.setLayoutManager(borderLayout);
label.add(textLabel, BorderLayout.CENTER); //孩子的位置
Button button = new Button("按钮");
label.add(button, BorderLayout.RIGHT); //孩子的位置
BorderLayout
最新推荐文章于 2023-01-14 10:56:06 发布
本文介绍了一种使用BorderLayout布局管理器进行界面设计的方法。通过实例展示了如何将文本标签和按钮添加到界面上,并设置了水平间距以美化界面布局。
149

被折叠的 条评论
为什么被折叠?



