简体   繁体   中英

Adding new objects to a jframe

I have seen a program and was hoping to replicate one feature of it in my program. The program is a flashcard app, and when you create a new deck it adds another section to the homescreeen. I will attach images. I would love some advice on how to do this.

在此处输入图片说明

One of possible way is to use correct layouts, here is examples . Using this you may dynamically add any components (labels, images, buttons etc.) into your JPanel (I recommend to use JPanel as main container of all components instead of JFrame that should be one and just contain your JPanel).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM