Remove Swing Component Using Validate or Revalidate

后端 未结 4 850
醉话见心
醉话见心 2020-12-10 15:32

Whenever I remove and add swing components from say JPanel, shall I perform call on validate or revalidate?

4条回答
  •  臣服心动
    2020-12-10 16:35

    I would think revalidate() is what you want. The validate() method will be automatically called for you after a call to revalidate(). See the Java API for JComponent.revalidate().

提交回复
热议问题