• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

JTable

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just want to do disable selection of a particular row.
Also I have list of rows out of multiple selection.
I want to disable selection for those rows and grey
them. Trying to find a solution.
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sankaran,
IMO, you would need to subclass the DefaultTableModel in order to stop editting. Something like the following:

I am not exactly sure how to perform what you want, but this could be a start.
Regards,
Manfred.
 
Sankaran Krishnan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Manfred Leonhardt:
[B]Hi Sankaran,
IMO, you would need to subclass the DefaultTableModel in order to stop editting. Something like the following:

I am not exactly sure how to perform what you want, but this could be a start.
Regards,
Manfred.[/B]


 
Sankaran Krishnan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just want disable a row and grey the selectedRow. Then onwards I don't want that row to be selected. Is there a exact solution for it.
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Krishnan
I think you can solve this problem round about way.
I am assuming that you are using JTable which uses AbstractTableModel.
To Make a gray row, you can do by extending DefaultTableCellRenderer, And you need to keep this row number.
Just allow multiple selection(No Problem Gray row can be selected)When you do some processing with multiple selected rows, Just neglect gray row(You know row numbers which are grayed), This process has to be done in class which extends AbstractTableModel..
This is just a concept in my mind. I am not sure this is what your looking for..
Mohana

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic