Why aren't my components wrapping in Swing's FlowLayout?

前端 未结 2 1776
走了就别回头了
走了就别回头了 2021-01-25 19:23

Why aren\'t my components wrapping in this JPanel using FlowLayout? They simply run off screen and are only partially visible.

JPanel panel = new JPanel(new Flo         


        
2条回答
  •  感动是毒
    2021-01-25 19:44

    That's because FlowLayout doesn't. I know, it sucks.

    But, you could take a look at WrapLayout which is a solution to this problem

提交回复
热议问题