Advertisement
Guest User

Untitled

a guest
May 27th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. public void commandAction(Command c, Displayable d) {
  2. if (c.getCommandType()==Command.SCREEN)
  3. {
  4. saveFile();
  5.  
  6. }
  7.  
  8. if (c.getCommandType()==Command.OK){
  9. try {
  10. Image[] listIcon = {icon16x16, icon18x18, icon20x20, icon22x22, icon32x32};
  11. //((FileConnection)(Connector.open("file:///"+roots[0]+"xxxx/"))).mkdir();
  12. FileConnection fc = (FileConnection)Connector.open("file:///"+roots[iconList.getSelectedIndex()]);
  13.  
  14. Enumeration fl = fc.list();//lista systemow
  15. Vector v = new Vector();
  16.  
  17. while(fl.hasMoreElements()){
  18. v.addElement(fl.nextElement());
  19. }
  20.  
  21. String[] files = new String[v.size()];
  22. v.copyInto(files);
  23.  
  24. iconList2 = new IconList(roots[iconList.getSelectedIndex()], List.IMPLICIT, files,listIcon, this);
  25.  
  26.  
  27. iconList2.addCommand(new Command("SAVE",Command.SCREEN,1));
  28. iconList2.addCommand(new Command("OK",Command.OK,1));
  29. iconList2.addCommand(new Command("BACK",Command.BACK,1));
  30. iconList2.setCommandListener(this);
  31.  
  32.  
  33. display.setCurrent(iconList2);
  34.  
  35. }
  36. catch (Exception ex){
  37. System.out.println("ERROR :[ ! -> ");
  38. ex.printStackTrace();
  39. }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement