Search:

Type: Posts; User: andbin

Search: Search took 0.12 seconds.

  1. Replies
    22
    Views
    1,620

    Re: JTable custom model listener

    I mean, in general, that it's not always necessary to keep an entire column in the internal data structure of the model for these button texts. Imagine a table model for stock prices, where the...
  2. Replies
    22
    Views
    1,620

    Re: JTable custom model listener

    The first important thing is that your getValueAt must return the button text when requested for the row/column of a button. How you decide what text to return is a "strategy" that involves only the...
  3. Replies
    22
    Views
    1,620

    Re: JTable custom model listener

    The value from getValueAt is, at the end, simply passed to the renderer. If your button-renderer doesn't care about the value, you can return null, "", anything you want.

    Imagine another scenario,...
  4. Replies
    22
    Views
    1,620

    Re: JTable custom model listener

    Where? I suspect in the getValueAt of your BanListTableModel.
    Describe (or post) your BanListTableModel.
  5. Replies
    22
    Views
    1,620

    Re: JTable custom model listener

    Wait! You are adding an explicit column! And a TableColumn has the 'modelIndex' property (getModelIndex/setModelIndex methods) that you have not configured, thus it's 0. In other words: when...
  6. Replies
    22
    Views
    1,620

    Re: JTable custom model listener

    Yes, for what I see it's the eighth column, that is index 7 (being 0-based). And what happens? Is the button clickable or not?

    P.S. do you have hidden/zero-width columns?
  7. Replies
    22
    Views
    1,620

    Re: JTable custom model listener

    The concept "if it's the buttons column, return true otherwise return false" is correct. But technically, is 7 the column index of buttons? Are you sure?
  8. Replies
    22
    Views
    1,620

    Re: JTable custom model listener

    A false from isCellEditable means primarily one thing: that the table cell editor never become "active".

    So you want button column editable and all other columns non-editable, right? And then your...
  9. Replies
    22
    Views
    1,620

    Re: JTable custom model listener

    First, just for clarity: you are speaking about a "listener". A table model is not a listener.
    It depends on what table model you have used. If you have used the constructor JTable(Object[][]...
Results 1 to 9 of 9