Results 1 to 2 of 2
Thread: JList with custom Array
- 10-09-2010, 06:13 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 1
- Rep Power
- 0
JList with custom Array
Hi guys
I am having a problem at the minute with my JList it is currently reading the data in ok from the JBoss server using a bean which connects to a sybase database.
The issue I am having is that I wish to customize what the display text is when I set the Data of the jlist. I would really appreciate any help you can offer me as I need to complete this project by the end of today.
private void UpdateLists()
{
jListMailSelect.setListData(currentUserMessageList );
jListUserSelection.setListData(dbconn.getAllUsers( ).toArray());
}
-
You might want to create a wrapper object that has a custom toString() method to hold each piece of data since default cell renderer used by JList uses toString to display the data. If this is not powerful enough, then you may need to create a custom cell renderer, and the JList tutorial can help you get started with this: JList Tutorial
Best of luck!
Similar Threads
-
Custom class in an array?
By bugmenot in forum New To JavaReplies: 5Last Post: 04-15-2009, 12:10 AM -
How to use a JList?
By glhansen in forum New To JavaReplies: 3Last Post: 03-24-2009, 10:27 AM -
JList
By pinks_70986 in forum New To JavaReplies: 1Last Post: 02-12-2009, 08:36 AM -
About JList
By hungleon88 in forum Advanced JavaReplies: 5Last Post: 08-30-2008, 09:24 PM -
Help with JList
By Albert in forum NetBeansReplies: 1Last Post: 07-13-2007, 03:42 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks