\r
if(e.isShiftDown())\r
{\r
- JButton start = (JButton)selectedButtons.elementAt(selectedButtons.size()-1);\r
- JButton end = (JButton) e.getSource();\r
+ JButton start, end = (JButton) e.getSource();\r
+ if(selectedButtons.size()>1)\r
+ start = (JButton)selectedButtons.elementAt(selectedButtons.size()-1);\r
+ else\r
+ start = (JButton) e.getSource();\r
+\r
int startIndex=0, endIndex=0;\r
for(int b=0; b<buttonPanel.getComponentCount(); b++)\r
{\r