开发者

Multiple Images with JScrollPane in JPanel

Ok, I am trying to add one row of multiple images to a JPanel, it can range from 15 - 30 images so I need to have a horizontal Scroll 开发者_JS百科Pane in the JPanel.

Now comes the hard part, how can I make it so the images can be removed then a new amount of images can be in its place?


You can either:

a) remove the images individually from the panel using the remove() method and then revalidate() the panel

Or

b) create a new panel with the new images and then add the panel to the scrollpane using the setViewportView(...) method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜