// appointment time and what not public void mouseClicked(MouseEvent e) { int row = Cal.getSelectedRow(); // this will give you the row number int col = Cal.getSelectedColumn(); // this will give you the column number if (row != -1 && col != -1 && Cal.getValueAt(row, col) != null) { // this now will only activate when there is an actual date associated with // that day input(row, col, currentYear); } }
@Override public void valueChanged(ListSelectionEvent lsEve) { int rowNum = table.getSelectedRow(); int colNum = table.getSelectedColumn(); // System.out.println("Reached in else"); if (colNum > 0) { selectAllCB.setVisible(false); deleteBut.setVisible(false); new MessagePan(rowNum, workingSet); backBut.setVisible(true); Home.home.homeFrame.setVisible(true); } }
/** * Move the currently selected cell up or down by one cell. * * @param direction -1 for previous, +1 for next. */ public void goToRow(int direction) { int row = table.getSelectedRow(); int column = table.getSelectedColumn(); table.changeSelection(row + direction, column, false, false); }