Package javax.swing

Examples of javax.swing.JTable.columnAtPoint()


  private void tableMouseRightClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tableMouseRightClicked
    if (!((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK))
      return;
    JTable myTable = (JTable)evt.getSource();
    Object value = myTable.getModel().getValueAt(myTable.rowAtPoint(evt.getPoint()), myTable.columnAtPoint(evt.getPoint()));
    if (value == null)
      return;
    ((JMultipleProseClient)getTopLevelAncestor()).newTextAreaContent(value.toString());
  }//GEN-LAST:event_tableMouseRightClicked
View Full Code Here


    JTable myTable = (JTable)evt.getSource();
    if (isActive(myTable))
      return;
    setActiveTable(myTable);
    ((WorksheetSingleClientModel)myTable.getModel()).setSelectedCells(new int[] { myTable.rowAtPoint(evt.getPoint()) });
    ((WorksheetSingleClientModel)myTable.getModel()).setSelectedColumn(myTable.columnAtPoint(evt.getPoint()));
  }//GEN-LAST:event_tableMouseClicked

  private void onMousePressed(java.awt.event.MouseEvent evt) {
    JTable myTable = ((JTableHeader)evt.getComponent()).getTable();
    if (isActive(myTable))
View Full Code Here

      @Override
      public void mouseReleased(final MouseEvent e) {
        if (e.isPopupTrigger()) {
          final JTable source = (JTable) e.getSource();
          final int row = source.rowAtPoint(e.getPoint());
          final int column = source.columnAtPoint(e.getPoint());

          if (!source.isRowSelected(row)) {
            source.changeSelection(row, column, false, false);
          }
View Full Code Here

      @Override
      public void mouseReleased(final MouseEvent e) {
        if (e.isPopupTrigger()) {
          final JTable source = (JTable) e.getSource();
          final int row = source.rowAtPoint(e.getPoint());
          final int column = source.columnAtPoint(e.getPoint());

          if (!source.isRowSelected(row)) {
            source.changeSelection(row, column, false, false);
          }
View Full Code Here

        (e.getClickCount() == 2)) {
      if (e.getSource() instanceof JTable) {
        JTable table = (JTable) e.getSource();
        if (table.getModel() instanceof PageListTableModel) {
          PageListTableModel model = (PageListTableModel) table.getModel();
          int column = table.columnAtPoint(e.getPoint());
          int row = table.rowAtPoint(e.getPoint());
          if ((column >= 0) && (row >= 0)) {
            row = Utilities.convertRowIndexToModel(table, row);
            Page page = model.getPage(row);
            if (Boolean.TRUE.equals(page.isDisambiguationPage())) {
View Full Code Here

      table.addMouseListener(new MouseAdapter() {

        private void maybeShowPopup(MouseEvent e) {
          if (e.isPopupTrigger() && table.isEnabled()) {
            Point p = new Point(e.getX(), e.getY());
            int col = table.columnAtPoint(p);
            int row = table.rowAtPoint(p);
            int mcol = table.getColumn(table.getColumnName(col))
                .getModelIndex();
            if (row >= 0 && row < table.getRowCount()) {
              JPopupMenu contextMenu = createContextMenu(row,
View Full Code Here

{
  @Override
  public void mouseMoved(MouseEvent e) {
    JTable aTable = (JTable) e.getSource();
    MouseHoverTable.itsRow = aTable.rowAtPoint(e.getPoint());
    MouseHoverTable.itsColumn = aTable.columnAtPoint(e.getPoint());
    aTable.repaint();
  }
}
View Full Code Here

    addMouseListener(new MouseAdapter(){
      public void mousePressed(MouseEvent e) {
       
        JTable table = (JTable)e.getSource();
        selectedRow = table.rowAtPoint(e.getPoint());
        selectedColumn = table.columnAtPoint(e.getPoint());
       
        //Edit Cell
        if(selectedColumn!=0 //v�ǺбⰡ �ƴѰ��
            && SwingUtilities.isLeftMouseButton(e)
            && e.getClickCount()==DOUBLE_CLICK
View Full Code Here

     * cell, or coordinate.
     */
    public ComponentLocation getLocation(Component c, Point p) {
        JTable table = (JTable)c;
        int row = table.rowAtPoint(p);
        int col = table.columnAtPoint(p);
        if (row != -1 && col != -1) {
            String value = valueToString(table, row, col);
            if (value != null)
                return new JTableLocation(value);
            else
View Full Code Here

            }
            // TF:23/9/07:We need to return the X and Y coordinates with respect to the cell, not the table. Also, we need
            // to change the child to the renderer or editor for that cell.
            Point loc = new Point(X, Y);
            int row = table.rowAtPoint(loc);
            int column = table.columnAtPoint(loc);
            // TF:27/9/07:Made the row and column 1-based indexes instead of 0-based
            params.put( "row", new ParameterHolder(row+1) );
            params.put( "column", new ParameterHolder(column+1) );

            // make sure we have a valid cell, just in case they click outside the table, eg in the empty scroll pane.
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.