简体   繁体   中英

Java Swing : Make a Scrollable list of JPanel

so i'm making an interface using NetBeans, and here's what I want to do :

I've created a JPanel class, wich shows some informations on objects (labels, texFields and buttons). I want to add several panels like the one above, into a same JScrollPane (to look like a list of independant Panels).

I can't use JList, because I don't want to list just the "toString" of my panels, I've look this : http://docs.oracle.com/javase/tutorial/uiswing/components/combobox.html#renderer But I don't think this can help me (this explain how to put icons into a cellRenderer, but i'd like to add directly a Panel into a vertical List of other panels)...

This example lets you scroll little thumbnail images, but the ImagePanel could have components. It uses FlowLayout for a horizontal layout, but GridLayout(0, 1) would work for a vertical layout.

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