Package javax.swing

Examples of javax.swing.JTable.requestFocus()


        }
      );
 
      //make sure that 1 station is selected from the beginning.
      //default: select the first row
      stationTable.requestFocus();
      stationTable.setRowSelectionInterval(0, 0);
      //activate the selected station
      String stationName = (String) stationDtm_.getValueAt(0, 0);
      CardLayout cl = (CardLayout)(dataPanel_.getLayout());
      cl.show(dataPanel_, stationName);
View Full Code Here


    public void actionPerformed(ActionEvent e) {
      JTable table = (JTable)e.getSource();
      if (!table.hasFocus()) {
        CellEditor cellEditor = table.getCellEditor();
        if (cellEditor != null && !cellEditor.stopCellEditing()) { return; }
        table.requestFocus();
        return;
      }
      ListSelectionModel rsm = table.getSelectionModel();
      int anchorRow = rsm.getAnchorSelectionIndex();
      table.editCellAt(anchorRow, PropertySheetTableModel.VALUE_COLUMN);
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.