Package javax.swing

Examples of javax.swing.JTable.rowAtPoint()


  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


  private void tableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tableMouseClicked
    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();
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

      jTable.setDoubleBuffered(true);
      jTable.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent _me) {
          JTable table = (JTable) _me.getSource();
          Point p = _me.getPoint();
          int row = table.rowAtPoint(p);
          //int col = table.columnAtPoint(p);
          String filename = null;
          if ((_me.getClickCount() == 2)) {
            try {
              // Open the file with associated viewer
View Full Code Here

    tbl.addMouseListener(new MouseAdapter() {
      @Override
      public void mousePressed(final MouseEvent me) {
        final JTable table = (JTable) me.getSource();
        final Point p = me.getPoint();
        final int row = table.rowAtPoint(p);
        /*
         * On double-click of the table item ...
         */
        if (me.getClickCount() == 2) {
          final PeerItem eval = model.getItem(row);
View Full Code Here

       
        private void showpopup(MouseEvent e) {
            if (e.isPopupTrigger()) {
                if (e.getSource() instanceof JTable) {
                    JTable table = (JTable)e.getSource();
                    int index = table.rowAtPoint(e.getPoint());
                    if (index >= 0) {
                        table.setRowSelectionInterval(index,index);
                    }
                   
                    jpmComments.show(table, e.getX(), e.getY());
View Full Code Here

       
        private void showpopup(MouseEvent e) {
            if (e.isPopupTrigger()) {
                if (e.getSource() instanceof JTable) {
                    JTable table = (JTable)e.getSource();
                    int index = table.rowAtPoint(e.getPoint());
                    if (index >= 0) {
                        table.setRowSelectionInterval(index,index);
                    }
                    jpmComments.show(table, e.getX(), e.getY());
                }
View Full Code Here

      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())) {
              Controller.runDisambiguationAnalysis(page.getTitle(), page.getWikipedia());
View Full Code Here

        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,
                  mcol);
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.