views:

37

answers:

2

Hello,

Before anything, I should admit that I am completely a newbie about Java Swing.

I am trying to create an application that lists emails similar to the way that Empathy displays a conversation.

What I want to achieve is like this: http://img69.imageshack.us/img69/5356/emailsx.png

They are going to be clickable.

The thing I have done was getting a JPanel on top of a JScrollPane, making the JPanel have GridLayout and trying to add components dynamically, but it looks plain ugly. Is there a way to do it in Swing or should I resort to using graphical images for the task? Also, how would I fix text placement if I used graphical images?

Thanks very much in advance.

+1  A: 

I'd consider using a JTable with a custom renderer in the scroll pane. You'll also want to look at JTabbedPane. Filthy Rich Clients is a popular choice for how to enhance a GUI.

trashgod
Thanks for your answer.
Emre
@Emre: You are welcome.
trashgod
A: 

I had problems with resizing in almost every layout manager. Finally I made something similar by designing a custom JPanel for a message. Then I added this custom JPanel dynamically using GroupLayout for each of the messages.

For the horizontal layout, I used ParallelGroup; and for the vertical layout, I used SequentialGroup.

Emre