I have a JPanel that uses FlowLayout. I add a number of JLabels to the JPanel, use setPreferedSize() to adjust their size and save them in a list, label_list. Everything works fine. Then I want to change their size:
for(JLabel c:label_list){
c.setPreferedSize(new Dimension(10,10));
}
And it doesn't work.
c.setBackground(Color.red)
and similar stuff works. Why can't I use setPreferedSize here?
c.setBounds(1,1,10,10) and c.setSize(10,10) Works, but after i update the UI (resizeing the panel) every size goes back to normal.