swing FlowLayout 간격 없애기

프로그래밍/java 2021. 12. 13. 22:27
반응형

https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/awt/FlowLayout.html

 

FlowLayout (Java SE 17 & JDK 17)

All Implemented Interfaces: LayoutManager, Serializable A flow layout arranges components in a directional flow, much like lines of text in a paragraph. The flow direction is determined by the container's componentOrientation property and may be one of two

docs.oracle.com

// layout 생성시
public FlowLayout(int align, int hgap, int vgap)
new FlowLayout(FlowLayout.LEADING, 0, 0);

// 가로 간격 없애기
public void setHgap(int hgap)
layout.setHgap(0);

// 세로 간격 없애기
public void setVgap(int vgap)
layout.setVgap(0);
반응형
: