Need one MultiColumnList component

Hi,

I need one component similar to JList but with multicolumn.

JList is list with only one column.

Any body has any idea.

pavan.
pavan_k_goyalAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

objectsCommented:
how about a JTable
0
pavan_k_goyalAuthor Commented:
No I don't want JTable....


Any thing else ?

Pavan

0
objectsCommented:
use multiple JList's.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

OviCommented:
If you are using JDK 1.4 and above, this feature is allready implemented. You can use'it like this:

JList list = new JList();
list.setLayoutOrientation(JList.VERTICAL_WRAP);
list.setFixedCellWidth(300);

This piece of code will create a list and wrap the data inside in multiple columns.
0
zzynxSoftware engineerCommented:
>> No I don't want JTable....
Any particular reason?
0
pavan_k_goyalAuthor Commented:
Ok. If I use JTable and set following selection mode

table.setRowSelectionAllowed(true);
and I click on one row in table, it select entire row but it keeps unselected the cell column under
the mouse pointer. and If I double click the mouse, Ican  change the content of cell , that I don't want.

How to prevent this ???


Pavan
0
objectsCommented:
maker your table model uneditable by having isCellEditable() return false.
0
pavan_k_goyalAuthor Commented:
Thanks, that worked fine.
Here I've some more problems.

JTable is drawing only as many lines as no of records(I'm passing at then time of table creation).
I have screen that has got one button and one text box and one Table.
Initially when I open that screen, I don't have any data to add to table.
User is supposed to enter some text in text box and click button... java program will fetch the data from database and retried data needs to be populated in Table.

I  want following things.

1. When I open the screen, (since I don't have any data) JTable should display blank lines.
2. I should be able to populate data n JTable Dyanamically based on the query results.
3. Currently Foreground colour for text in JTable is black. When I select a record, it's color should change to white(beacuse I need selec tion color to be black).


Pavan
0
objectsCommented:
Fill your table with empty rows, and when populating instead of adding new rows fill in the empty ones.
Use table.setSelectionForeground(Color.white) to change the selected foreground colour.
0
pavan_k_goyalAuthor Commented:
I have to use this Table in many screens... and I can not hardcode blank numbers of rows.

Any other solution ?

Pavan.
0
objectsCommented:
No alternative that I can think of. The table only renders rows that exist in the model, if there are no rows then its not going to paint any.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.