Package javax.swing

Examples of javax.swing.JTable.rowAtPoint()


                    if (e.getClickCount() > 1 || SwingUtilities.isRightMouseButton(e)) {
                        return;
                    }
                    final JTable thisTable = (JTable) e.getSource();
                    final Point p = e.getPoint();
                    final int row0 = thisTable.rowAtPoint(p);
                    final int column = thisTable.columnAtPoint(p);
                    final MyButton keyB = (MyButton) thisTable.getValueAt(row0, 0);
                    rowClicked(tableName, keyB.getText(), column);
                }
View Full Code Here


                @Override
                public void mousePressed(final MouseEvent e) {
                    final JTable thisTable = (JTable) e.getSource();
                    final Point p = e.getPoint();
                    row = thisTable.rowAtPoint(p);
                    final MyButton b = (MyButton) thisTable.getValueAt(row, 0);
                    if (SwingUtilities.isRightMouseButton(e)) {
                        final Info info = getTableInfo(tableName, b.getText());
                        if (info != null) {
                            info.showPopup(thisTable, e.getX(), e.getY());
View Full Code Here

                @Override
                public void mouseEntered(final MouseEvent e) {
                    final JTable thisTable = (JTable) e.getSource();
                    final Point p = e.getPoint();
                    final int row0 = thisTable.rowAtPoint(p);
                    try {
                        for (int c = 0; c < thisTable.getColumnCount(); c++) {
                            final Object v = thisTable.getValueAt(row0, c);
                            if (v instanceof MyButton) {
                                ((AbstractButton) v).getModel().setRollover(true);
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

    JComponent component = (JComponent)event.getSource();
    String toolTipText;
    if (component instanceof JTable)
    {
      JTable table = (JTable)component;
      int row = table.rowAtPoint(event.getPoint());
      int column = table.columnAtPoint(event.getPoint());
      if (row != -1 && column != -1)
      {
        TableCellRenderer renderer = table.getCellRenderer(row, column);
        Component comp = renderer.getTableCellRendererComponent(table,
View Full Code Here

                    @Override
          public void mouseClicked(MouseEvent e) {
                        if( e.getClickCount() < 2 )
                            return;
                        JTable table = (JTable)e.getSource();
                        int row = table.rowAtPoint(e.getPoint()),
                            col = table.columnAtPoint(e.getPoint());
//                        System.out.println(row + ":"+col);
                        if( row>=0 && col>=0 )
                        {
                            col = table.convertColumnIndexToModel(col);
View Full Code Here

                mergeDecision = MergeDecisionType.UNDECIDED;
            } else
                // double click in another component; shouldn't happen,
                // but just in case
                return;
            int row = table.rowAtPoint(e.getPoint());
            model.decide(row, mergeDecision);
        }
    }

    /**
 
View Full Code Here

                JTable t = (JTable) e.getSource();
                int col = t.convertColumnIndexToModel(t.columnAtPoint(e.getPoint()));
                if (col != 4) {
                    return;
                }
                int row = t.rowAtPoint(e.getPoint());
                String url = (String) t.getValueAt(row, col);
                if (url == null || url.isEmpty()) {
                    return;
                }
                OpenBrowser.displayUrl(url);
View Full Code Here

      private void checkForTriggerEvent(final MouseEvent e) {
        if (e.isPopupTrigger()) {
          area.requestFocus();

          final JTable myTable = (JTable) e.getSource();
          final int c = myTable.rowAtPoint(new Point(e.getX(), e
              .getY()));

          myTable.getSelectionModel().setAnchorSelectionIndex(c);
          myTable.setRowSelectionInterval(c, c);
          myTable.getSelectionModel().setSelectionInterval(c, c);
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.