How to set size of swing components

前端 未结 6 1299
挽巷
挽巷 2020-12-22 02:44

I want to customize the height and width of the JTextField objects. I have tried with the setSize method, passing width and height as dimensions and as int as well. But none

6条回答
  •  借酒劲吻你
    2020-12-22 03:16

    Let the layout manager take care of the dimensions of your Swing components, but if you absolutely must, use setPreferredSize in combination with a layout manager that respects that property.

提交回复
热议问题