简体   繁体   中英

java swing -Create a button like carousel in java swing

I would like to ask your help to get me started in creating a carousel like button list in java swing. Is there any tutorial/ example or links you can provide me to get me started. I would like to create 15 buttons that can be scrollable from left to right only 10 buttons will be visible and the rest will be scrolled just like a carousel in

Thanks

You should investigate a JScrollPane. If you put a panel inside a scroll pane and make that panel sufficiently wide (by, in this case, placing more buttons horizontally than can fit physically on the viewable width), then the scroll pane will automatically provide a bar that will scroll the inner panel left and right.

这可以从http://java-sl.com/tip_slider.html开始。它描述了滑动一个组件但你可以扩展它。

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