Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void commandAction(Command c, Displayable d) {
- if (c.getCommandType()==Command.SCREEN)
- {
- saveFile();
- }
- if (c.getCommandType()==Command.OK){
- try {
- Image[] listIcon = {icon16x16, icon18x18, icon20x20, icon22x22, icon32x32};
- //((FileConnection)(Connector.open("file:///"+roots[0]+"xxxx/"))).mkdir();
- FileConnection fc = (FileConnection)Connector.open("file:///"+roots[iconList.getSelectedIndex()]);
- Enumeration fl = fc.list();//lista systemow
- Vector v = new Vector();
- while(fl.hasMoreElements()){
- v.addElement(fl.nextElement());
- }
- String[] files = new String[v.size()];
- v.copyInto(files);
- iconList2 = new IconList(roots[iconList.getSelectedIndex()], List.IMPLICIT, files,listIcon, this);
- iconList2.addCommand(new Command("SAVE",Command.SCREEN,1));
- iconList2.addCommand(new Command("OK",Command.OK,1));
- iconList2.addCommand(new Command("BACK",Command.BACK,1));
- iconList2.setCommandListener(this);
- display.setCurrent(iconList2);
- }
- catch (Exception ex){
- System.out.println("ERROR :[ ! -> ");
- ex.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement