Home arrow static arrow Java Programming [Archive] - a swing question
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - a swing question
This topic has 7 replies on 1 page.

Posts:78
Registered: 12/9/03
a swing question  
Aug 8, 2004 6:39 AM



 
Hi, for my MSc. project I'm building an application that includes an image search engine (using lucene).

I just need a bit of advice with regard search results and the best Swing component to display them with, so that a user can then make a selection from the search results.

At the moment the user searches and a list of results is returned (along with descriptions). I am putting each one in a JPanel and the results list is just a list of Jpanels. I know that this is very basic (i'm teaching myself).

What is the best component to display search results in, in order for a user to then select a result, which can then be used by the programme. Is a JList suitable ?

Any advice of which java swing component to use would be great.
 

Posts:18,384
Registered: 21.03.00
Re: a swing question  
Aug 8, 2004 6:42 AM (reply 1 of 7)



 
Hi,

I would say that you should use a JTable, since you might want to display a thumbnail in one column, a text in another etc.

/Kaj
 

Posts:78
Registered: 12/9/03
Re: a swing question  
Aug 8, 2004 6:46 AM (reply 2 of 7)



 
cool.

and then for the user to select a result from the JTable, would i add a JButton (select) in each row or is there a more standard or efficient way of doing it?
 

Posts:18,384
Registered: 21.03.00
Re: a swing question  
Aug 8, 2004 6:48 AM (reply 3 of 7)



 
Hi,

The JTable handles selections, you can define if you want to allow multi line selects, or not. Then just add a JButton below the table that says. Show, display or some thing like that.

/Kaj
 

Posts:78
Registered: 12/9/03
Re: a swing question  
Aug 8, 2004 6:52 AM (reply 4 of 7)



 
tx !

colin
 

Posts:18,384
Registered: 21.03.00
Re: a swing question  
Aug 8, 2004 6:54 AM (reply 5 of 7)



 
You're welcome.

/Kaj
 

Posts:24,517
Registered: 98-02-27
Re: a swing question  
Aug 8, 2004 7:46 AM (reply 6 of 7)



 
Don't cross post. A Swing question belongs in the Swing forum and since you already posted a question there you don't need to post it here as well.
 

Posts:78
Registered: 12/9/03
Re: a swing question  
Aug 8, 2004 8:00 AM (reply 7 of 7)



 
only posted it here as there didn't seem to be anybody in the other forum.

thanx for your reply over there.
 
This topic has 7 replies on 1 page.