Invisible column in JTable

Discussion in 'Java' started by Ike, Aug 20, 2003.

  1. Ike

    Ike Guest

    Anyone know how to make a column invisible in a JTable? I have tried setting
    the width of the column to 0, but it still shows up with elipses (...) in
    the column and hence a nominal width.

    Anyone ev er encountered this? Thanks, Ike
     
    Ike, Aug 20, 2003
    #1
    1. Advertising

  2. Ike

    Eric Sosman Guest

    Ike wrote:
    >
    > Anyone know how to make a column invisible in a JTable? I have tried setting
    > the width of the column to 0, but it still shows up with elipses (...) in
    > the column and hence a nominal width.


    removeColumn() seems a good bet.


    --
     
    Eric Sosman, Aug 20, 2003
    #2
    1. Advertising

  3. Ike

    Daniel Dyer Guest

    On Fri, 22 Aug 2003 09:05:51 +0300, timo <>
    wrote:

    > Ike wrote:
    >
    >> Anyone know how to make a column invisible in a JTable? I have tried
    >> setting the width of the column to 0, but it still shows up with elipses
    >> (...) in the column and hence a nominal width.

    >
    > Not really sure why you want to do this but if I were to really hide
    > a column I would tinker with the data model so that its TableModel
    > interface returns less data than what the model really contains.
    > Of course one would need to add a couple of new methods for enabling
    > the hidden data somehow.


    That's along the right lines, but use the TableColumnModel rather than the
    TableModel, it makes things easier.

    Dan.


    --
    Daniel Dyer
    Empathy Software (http://www.empathysoftware.com)


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
     
    Daniel Dyer, Aug 22, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tivo Escobar
    Replies:
    1
    Views:
    7,555
    manusa
    Apr 12, 2007
  2. Tintin92
    Replies:
    1
    Views:
    1,813
    Andrew Thompson
    Feb 14, 2007
  3. Replies:
    2
    Views:
    636
  4. Andy B
    Replies:
    5
    Views:
    630
    Andy B
    May 29, 2008
  5. Haircuts Are Important
    Replies:
    3
    Views:
    415
    Haircuts Are Important
    Jun 4, 2013
Loading...

Share This Page