示例#1
0
  public Ticket getSelectedTicket() {
    int selectedRow = table.getSelectedRow();
    if (selectedRow < 0) {
      return null;
    }

    return (Ticket) tableModel.getRowData(selectedRow);
  }
示例#2
0
  public List<Ticket> getSelectedTickets() {
    int[] selectedRows = table.getSelectedRows();

    ArrayList<Ticket> tickets = new ArrayList<Ticket>(selectedRows.length);

    for (int i = 0; i < selectedRows.length; i++) {
      Ticket ticket = (Ticket) tableModel.getRowData(selectedRows[i]);
      tickets.add(ticket);
    }
    return tickets;
  }
示例#3
0
 public void addTicket(Ticket ticket) {
   tableModel.addItem(ticket);
 }
示例#4
0
 public void setTickets(List<Ticket> tickets) {
   tableModel.setRows(tickets);
 }