Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.csi.contadoralumnos.application
- import scala.swing._
- import javax.swing.filechooser.FileNameExtensionFilter
- object contadorAlumnos extends Application {
- val frm = new FileChooser
- frm.fileFilter = new FileNameExtensionFilter("Archivo Excel", "xlsx")
- frm.showDialog(null, "Seleccione Archivo")
- var filePath = ""
- try {
- filePath = frm.selectedFile.toString
- } catch {
- case npe: NullPointerException => exit // esperado al presionar cancelar.
- case e: Exception => e.printStackTrace //no esperado, imprime exception.
- }
- if (!filePath.endsWith("xlsx")) {
- Dialog.showMessage(null, "Archivo no valido.", "Error", Dialog.Message.Error)
- exit
- }
- def csiExcel = new CSIExcel(filePath)
- csiExcel.process
- Dialog.showMessage(null, "Procesamiento Terminado.", "Fin", Dialog.Message.Info)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement