This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. package org.jpa; | |
2. import java.io.Serializable; | |
3. import javax.persistence.Column; | |
4. import javax.persistence.Entity; | |
5. import javax.persistence.Id; | |
6. import javax.persistence.Table; | |
7. @Entity | |
8. @Table(schema="sistema", name = "estudiante") | |
9. public class Estudiante implements Serializable { | |
10. @Id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. package org.jpa; | |
2. import java.io.Serializable; | |
3. import javax.persistence.Column; | |
4. import javax.persistence.Entity; | |
5. import javax.persistence.Id; | |
6. import javax.persistence.Table; | |
7. @Entity | |
8. @Table(schema="sistema", name = "estudiante") | |
9. public class Estudiante implements Serializable { | |
10. @Id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import javax.swing.*; | |
import jxl.write.*; | |
import jxl.*; | |
public class ExcelTableExporter { | |
private File file; | |
private JTable table; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int i=0;i< table.getColumnCount();i++){ | |
for(int j=0;j<table.getRowCount();j++){ | |
Object objeto=table.getValueAt(j,i); | |
s.addCell(new Label(j, i, String.valueOf(objeto))); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
w.write(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import javax.swing.*; | |
import jxl.write.*; | |
import jxl.*; | |
public class ExcelTableExporter { | |
private File file; | |
private JTable table; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean export(){ | |
try | |
{ | |
//Nuestro flujo de salida para apuntar a donde vamos a escribir | |
DataOutputStream out=new DataOutputStream(new FileOutputStream(file)); | |
//Representa nuestro archivo en excel y necesita un OutputStream para saber donde va locoar los datos | |
WritableWorkbook w = Workbook.createWorkbook(out); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BusinessExpandableListAdapter<T> extends BaseExpandableListAdapter{ | |
private Context contexto; | |
protected HashMap<String, List<T>> mapList; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean hasStableIds() { | |
return true; | |
} | |
@Override | |
public boolean isChildSelectable(int groupPosition, int childPosition) { | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Esto me hara mi adaptador personalizado con listado de personas. | |
//this siempre y cuando sea un Context y mapList un Map<String, List<T>> | |
CustomExpandableListAdapter<Person> myAdapter=new CustomExpandableListAdapter<Person>(this, mapList); |
OlderNewer