• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable with TextRenderes as TextPane

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is "TextPane" a JTextField and what do you mean "get the TextPane object back"?
 
Jeetendra Dhake
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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."
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps we could do more to help you if you expressed what you are trying to, what your goal is.
 
Jeetendra Dhake
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

reply
    Bookmark Topic Watch Topic
  • New Topic