Hi All , I am a silent Memeber of this Group. I am stuck up with JTable. I am making a JTable and Has used the TextPane as TextRenderes in each cell. Now the problem is that i am not able to get the TextPane object back when the user selects a specific cell.
Can any one please help me with this .. I am Stuck with this since 15 days ....
Is "TextPane" a JTextField and what do you mean "get the TextPane object back"?
Joined: Jul 20, 2005
Yes Its A JTextField . I want to edit the Properties of the JTextPane which is in the JTable . But Unless and Untill i get the JTextPane Object Back from the JTable i wont be able to Change the Properties . Any way by which i will het the JTextPane object back from the JTable which is made from the JTextPane as the Cells .
It's kind of hard to figure out what you are asking.
Are you saying that your table contains JTextPanes, as in your table model's getValueAt() method returns one? If so, then that's kind of a weird appreach, but the answer to your question is you can "get the TextPane object back" by simply calling the model's getValueAt() method.
Otherwise, you're table does not actuall contain JTextPanes, but merely uses a JTextPane to render the cells. In this case, the JTextPane is a transient object that exists just long enough to draw the cell and then vanishes (at least that's how it looks from the cell's point of view) so there's no way to "get the TextPane object back."
Perhaps we could do more to help you if you expressed what you are trying to, what your goal is.
There is no emoticon for what I am feeling!
Joined: Jul 20, 2005
Actually i want to make a Table in which, as and when i will type the text in the cell the text Should WRAP up increasing the height of the Cell and when the text is deleted from the cell the cells height should decrease . So i have used a JTextPane as My CellRenderer as the wraping feature is provided By JTextPane. But i am not able to implement the KeyListener on the JTable's perticular cell .as The cell has JTextPane as cell renderer .
Can u please suggest me something regarding this Problem . Thankxs a Lot in advance