Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. public void moveToQ1() {
  2.  
  3. index = customerList.getSelectedIndex();
  4. if (index != -1) {
  5.  
  6. browsing.dequeue(customerList);
  7. q1.enqueue(browsing, customerList, queue1, index);
  8.  
  9. }
  10. }
  11.  
  12. public void enqueue(QueLine queline, JList list1, JList list2, int index) {
  13.  
  14. DefaultListModel<Customer> browseModel = (DefaultListModel<Customer>) list1.getModel();
  15. DefaultListModel<Customer> queueModel = (DefaultListModel<Customer>) list2.getModel();
  16.  
  17. int selectedIndex = index;
  18. System.out.printf("%dn", selectedIndex);
  19.  
  20. if(selectedIndex >= -1) {
  21. queueModel.addElement(browseModel.getElementAt(selectedIndex));
  22. }
  23.  
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement