Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
    Bookmark Topic Watch Topic
  • New Topic

JList with variable row height (Urgent!)  RSS feed

 
S Dan
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Report post to moderator
How can I implement a JList with varible row height? Can someone provide me a complete example code?
I've overridden
getListCellRendererComponent. I'm trying to change the height of a particular row when the cell is selected. So I'm trying to do this inside the getListCellRendererComponent method..
if(isCellSelected){
this.setPreferredSize(new Dimension((int)this.getSize().getWidth(),50));
this.validate();
}

No effect whatsover. Using setSize instead of setPreferredSize doesn't help either.

Thanks.
-Dan
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Seems to me that you already asked this question and got a response, which obviously didn't work, but a response none-the-less. Please don't post the same question more than once just because you didn't like the answer(s) you received. Please continue disucssion of this topic in this thread as this one is now closed.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!