Package javax.swing

Examples of javax.swing.JTable.convertRowIndexToModel()


        List<T> move = new ArrayList<T>();
        if (selected.getSelectedRowCount() <= 0) {
          return;
        }
        for (int row : selected.getSelectedRows()) {
          int modelIndex = selected.convertRowIndexToModel(row);
          T item = selectedModel.list.get(modelIndex);
          move.add(item);
        }
        selectedModel.list.removeAll(move);
        availableModel.list.addAll(move);
View Full Code Here


        // 抽出期間が変化しても,できるだけ現在の選択を再現するため保存しておく
        JTable table = view.getTable();
        List<String> oldSelection = new ArrayList<String>();
        for (int r : table.getSelectedRows()) {
            int row = table.convertRowIndexToModel(r);
            String date = ((DocInfoModel) tableModel.getObject(row)).getFirstConfirmDateTrimTime();
            oldSelection.add(date);
        }
           
        // 文書履歴テーブルにデータの Arraylist を設定する
View Full Code Here

            table.addMouseListener(new MouseAdapter() {           
                @Override
                public void mouseClicked(MouseEvent e) {
                    Point pnt = e.getPoint();
                    int columnModelIndex = table.convertColumnIndexToModel(table.columnAtPoint(pnt));
                    int rowModelIndex = table.convertRowIndexToModel(table.rowAtPoint(pnt));
                    // click on favorite column
                    // start favorite action                   
                    if (columnModelIndex == tableProperties.getFavoriteColIndex()){                     
                      if (actionCounter < maxSameTimeActions){
                        actionCounter++;                        
View Full Code Here

      @Override
      public void valueChanged(final ListSelectionEvent e) {
        SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
            final int index = matchesTable.convertRowIndexToModel(matchesTable.getSelectedRow());
            final Optional<IWVWMatch> matchOptional = MainWindow.this.matchesTableModel.getMatch(index);
            if (matchOptional.isPresent()) {
              LOGGER.debug("Incoming selection event [" + index + "] -> match=" + matchOptional.get().getId());
              if (!selectedMatch.equals(matchOptional)) {
                selectedMatch = matchOptional;
View Full Code Here

                selectionBuffer
                .append(table
                    .getModel()
                    .getValueAt(
                        table
                        .convertRowIndexToModel(element),
                        i));
                if (i < table.getColumnCount() - 1) {
                  selectionBuffer.append(",");
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.