I am trying to display protein sequence alignments in a java application for a college research project. I had the idea to use a JTable with a JLabel in each cell to hold the amino acids in the sequence. I need to be able to change the background color, text color, and have each cell event driven. Is there a better way to do this?
Asked
Active
Viewed 164 times
1 Answers
1
A simple alternative would be to use JTextArea, representing each protein sequence as a line of text, with hyphens for gaps.
If you go forward with the JTable idea, look at:
- javax.swing.table.AbstractTableModel, which allows you to provide and update data
- javax.swing.table.TableCellRenderer, which allows you to specify how to draw data

Andy Thomas
- 84,978
- 11
- 107
- 151
-
I thought about using a text area, but the user needs to be able to delete columns, insert columns, select blocks from the alignment, and have the option to shade columns with similar amino acids. I think those were what I was looking for though, thanks – Pete Jun 26 '12 at 14:08