File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JTable with TextRenderes as TextPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable with TextRenderes as TextPane" Watch "JTable with TextRenderes as TextPane" New topic
Author

JTable with TextRenderes as TextPane

Jeetendra Dhake
Greenhorn

Joined: Jul 20, 2005
Posts: 4
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 ....


regards
Jeetendra


Regards<br /> <br /> Jeetendra Dhake
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
Is "TextPane" a JTextField and what do you mean "get the TextPane object back"?
Jeetendra Dhake
Greenhorn

Joined: Jul 20, 2005
Posts: 4
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 .

Thankxs in Advance.

Jeetendra
Brian Cole
Author
Ranch Hand

Joined: Sep 20, 2005
Posts: 862
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."


bitguru blog
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
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!
Jeetendra Dhake
Greenhorn

Joined: Jul 20, 2005
Posts: 4
Hi ,

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

Jeetendra

 
jQuery in Action, 2nd edition
 
subject: JTable with TextRenderes as TextPane
 
Similar Threads
JTable
JTable
JTable
JTable
JTable