Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
ListSelectionModel rowSM = table.getSelectionModel();
//Listener for row change;
rowSM.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
if (e.getValueIsAdjusting()) return;
table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
ListSelectionModel lsm =
(ListSelectionModel)e.getSource();
if (lsm.isSelectionEmpty()) {
} else {
int selectedRow = lsm.getMinSelectionIndex();
Boolean theBox = (Boolean)table.getValueAt(selectedRow, 0);
JProgressBar theBar = (JProgressBar)table.getValueAt(selectedRow, 3);
if (theBox == true)
{
theBar.setValue((theBar.getValue()+1));
}
else
{
theBar.setValue((theBar.getValue()-1));
}
theBar.setString(String.valueOf(theBar.getValue()).concat("%"));
}
}
});