• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

JTable/Column modification /urgent

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello friends,
I have a problem in JTable.I have to make a particular cell multiline in JTable.
How colud i do this.
I have 2 columns & many rows in JTable.In second column all or a particular row should be multiline.
How colud i do this.
Excepting u'r replies,
with regards,
Sonara.


 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#editrender. refer TableDialogEditDemo.java example.
The above gives an examples of how to use different editors on a column. If u can make use of a text area i think your problem of multi line can be solved.
Regards,
Jagan Mohan Reddy.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello friend,
Thanks for u'r reply.It's working fine.Now i need one more help from u.In JTable when any column is selected i need to do one event,else that event shouldn't be triggered.
Any row or column is selected means this should happen.
there r isselected(rowcount,columncount) methods.But i don't have to specify the row or column count.If any row or column is selected i need to make a event happen.
How can i get this.
Excepting u'r reply,
cinderalla.
 
Jagan Reddy
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Add the TableModelListner to your table.
get the selectedRow using getSelectedRow()
get the selectedColumn using getSelectedColumn()..
Depending upon your requirement of the row and column fire your events..
If this is what you want,then i hope this solves your problem..
else can you be much more clear in your question.
Regards,
Jagan Mohan Reddy
 
reply
    Bookmark Topic Watch Topic
  • New Topic