This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Hi ranch members, This is the first mail from me, but I have been following you for a while. I am workin on Bodgitt & Scarper assignment and I am almost done with the programming part. Just as you know it - the forum has been a fantastic place to get inspiration and help. Now to my question: I am doing all my configuration in a JTable - (property,value)-pairs - and one of my configuration parameters are what log-level to use (I use Java standard logger and only FINE, WARNING and ERROR). My problem is that I would like this choice to be a non-editable JComboBox residing inside a JTable. I have come so far that I have written my own cell editor: public class LogCellEditor extends DefaultCellEditor and I use this from inside my table model:
But when I do this it apparently overrides my isCellEditable(int r, int c) method in my TableModel. In this way I can only choose to have all cells in a column using JComboBox (which was not the intention) or to have only the cell using my JComboBox editable - also not the intention. Before dropping the idea as a whole I though I would ask all of you - anybody has a good idea? [Andrew: put the source code between [code] and [/code] UBB tags] [ May 04, 2004: Message edited by: Andrew Monkhouse ]
Hi Martin, Welcome to JavaRanch and this forum. I have edited your post to put the code between [code] and [/code] UBB tags. Doing this ensures that indenting is preserved, which makes the code easier to read. When you are writing your post, there are a number of buttons just below the edit pane, which will insert the tags for you, so you don't have to remember what they are. If you would like to edit your original post so that you can see what I have done, you can click on the button that is just above your post. Sorry I don't have time right now to think of what a possible answer might be - hopefully someone else here will give you some ideas shortly. Regards, Andrew