Search:

Type: Posts; User: copeg

Search: Search took 0.44 seconds.

  1. Thread: JTable Questions

    by copeg
    Replies
    21
    Views
    4,893

    Re: JTable Questions

    table.setCellSelectionEnabled(true);


    To allow cell selections. The adding a ListSelectionListener to the SelectionModel will only fire upon row selection. If you add a ListSelectionListener on...
  2. Thread: JTable Questions

    by copeg
    Replies
    21
    Views
    4,893

    Re: JTable Questions

    First tip: when you call getSelectedRow() on a JTable, its always good practice to make sure it does not return -1 (if nothing is returned), otherwise when your code continues an exception may be...
  3. Thread: JTable Questions

    by copeg
    Replies
    21
    Views
    4,893

    Re: JTable Questions

    If you just need to listen for selection events, register a ListSelectionListener on the table's selection model.
  4. Thread: JTable Questions

    by copeg
    Replies
    21
    Views
    4,893

    Re: JTable Questions

    Doh! Thanks for the correction. My brain is running on low today
  5. Thread: JTable Questions

    by copeg
    Replies
    21
    Views
    4,893

    Re: JTable Questions

    Tables aren't extremely intuitive until you start using them quite a bit.
    You may wish to change your model TableMode to avoid naming conflictsl, since (indirectly) it is implementing TableModel.
    ...
  6. Thread: JTable Questions

    by copeg
    Replies
    21
    Views
    4,893

    Re: JTable Questions

    Create a custom TableModel (extend AbstractTableModel or DefaultTableModel) and set the table model to this custom model. Using the custom model will allow you to change the table quite dynamically...
Results 1 to 6 of 6