作者:serafina捡到一枚人鱼 | 来源:互联网 | 2023-05-19 07:26
Ihavethefollowingsituation:我有以下情况:LabellabelnewLabel();label.setText(bla);RoundedRec
I have the following situation:
我有以下情况:
Label label = new Label();
label.setText("bla");
RoundedRectangle fig = new RoundedRectangle();
fig.add(label);
FlowLayout layout = new FlowLayout();
layout.setStretchMinorAxis(true);
fig.setLayoutManager(layout);
fig.setOpaque(true);
That works only to center the label vertical or horizontal by using layout.setHorizontal(true/false); , but not together. Any idea how to make it work ?
这只能通过使用layout.setHorizontal(true / false)使标签垂直或水平居中; ,但不是在一起。知道如何让它工作吗?
2 个解决方案