开发者

JList: Horizontal_WRAP fitted?

开发者 https://www.devze.com 2023-02-01 01:17 出处:网络
Hey,.. i wanna show pictures with names onit in开发者_JAVA百科 a jList, i know it get\'s also in a JPanel but i\'m now using a jList, doesn\'t matter..

Hey,.. i wanna show pictures with names onit in开发者_JAVA百科 a jList, i know it get's also in a JPanel but i'm now using a jList, doesn't matter..

My question is why does the jlist don't fit the images only in 2 horizontal 'cells' and then go one row down?

sry my english is bad and i don't know how to describe it better, but look on the picture, why does the jlist dont set the e.g. 3rd picture right next to the 2nd?

JList: Horizontal_WRAP fitted?


JList.HORIZONTAL_WRAP works correctly in the ListDialog JWS demo, as described in Initializing a List. I suspect a layout problem, but you might compare your code to the examples found there.


If you use HORIZONTAL_WRAP you can adjust the number of columns with setVisibleRowCount. If you want them automatically fitted to the width of the list, use 0 or something negative.

0

精彩评论

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

关注公众号