How to Dynamically Add JButton to JPanel?

后端 未结 3 564
傲寒
傲寒 2020-12-06 23:51

In NetBeans, I have used the GUI editor to make a JFrame and I\'ve put a JPanel in the frame. At the moment, I\'m trying to make a new button in the panel when the class con

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-07 00:19

    Create Dynamic JButton with Image and ActionListener - Java Swing

    Create JButton dynamically with Image and the ActionListener . You will be able to change the button height , width horizontal gap and vertical gap in one place.

    you can find more details from here

    enter image description here

提交回复
热议问题