Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #36648

Re: How are you supposed to set JTable height?

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: How are you supposed to set JTable height?
Date 2017-05-20 07:59 -0400
Organization A noiseless patient Spider
Message-ID <ofpasc$rti$1@dont-email.me> (permalink)
References (1 earlier) <ofn2ds$4uu$1@dont-email.me> <92a3c52c-8ac7-49f5-9b46-794224e13642@googlegroups.com> <ofndc1$jde$1@dont-email.me> <266d8f3d-b922-42d4-b3c1-f00e8a95574d@googlegroups.com> <80c877a7-0ea7-4869-ace6-54bb6fb04c16@googlegroups.com>

Show all headers | View raw


On 5/19/2017 4:06 PM, Eric Douglas wrote:
> On Friday, May 19, 2017 at 2:43:03 PM UTC-4, Eric Douglas wrote:
>>>
>> I'm testing these more specific methods and this is tedious.  I call fireTableCellUpdated and it crashes saying default row sorter reports row out of range.  So I have to nail that down or go back to an update all.
> 
> Now that I got that worked out I'm back to the hard part.
> I'm trying to make accessible rows disappear.  From what I could find searching the internet for this they just say use the RowFilter, but that makes them inaccessible.  I don't want the user to be able to see them or edit them, but I want the program to call get and set methods as if they're showing normally.

     I'm not sure what's going on, because it seems straightforward and
should work as advertised (has worked as advertised, for me).  You can
modify the contents of your TableModel without regard to whether the
cells are or aren't visible; "as if they're showing normally."  The
JTable listens to its model, and when it receives a change event it
first determines whether the change is to a visible part of the table.
If the changed cells are not visible -- hidden by a RowFilter, or just
scrolled out of sight -- nothing gets repainted.

> I hacked the UI to not show them which is the easy part since I already implemented an extension of BasicTableUI for another custom view [...]

     I can't help you with this part, since I've never tried to mess
with the plaf layers.  On the other hand, I've never needed to: For
filtering, sorting, and custom-painting rows and cells, I've just
used RowFilter, TableRowSorter, and sometimes a customized
TableCellRenderer or TableCellEditor.  These have met my needs
without recourse to mucking about in the lower levels.

-- 
esosman@comcast-dot-net.invalid
Thirteen hundred forty-two days to go.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How are you supposed to set JTable height? Eric Douglas <e.d.programmer@gmail.com> - 2017-05-19 07:20 -0700
  Re: How are you supposed to set JTable height? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-05-19 11:22 -0400
    Re: How are you supposed to set JTable height? Eric Douglas <e.d.programmer@gmail.com> - 2017-05-19 10:45 -0700
      Re: How are you supposed to set JTable height? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-05-19 14:29 -0400
        Re: How are you supposed to set JTable height? Eric Douglas <e.d.programmer@gmail.com> - 2017-05-19 11:42 -0700
          Re: How are you supposed to set JTable height? Eric Douglas <e.d.programmer@gmail.com> - 2017-05-19 13:06 -0700
            Re: How are you supposed to set JTable height? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-05-20 07:59 -0400
              Re: How are you supposed to set JTable height? Eric Douglas <e.d.programmer@gmail.com> - 2017-05-22 04:55 -0700
                Re: How are you supposed to set JTable height? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-05-22 09:00 -0400
                Re: How are you supposed to set JTable height? Eric Douglas <e.d.programmer@gmail.com> - 2017-05-22 06:42 -0700
                Re: How are you supposed to set JTable height? Eric Douglas <e.d.programmer@gmail.com> - 2017-05-22 09:18 -0700
                Re: How are you supposed to set JTable height? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-05-22 17:15 -0400

csiph-web