Protein Sequence Display
-
17-06-2021 - |
Question
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?
Solution
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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow