Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Hello old friend!

Necronet necronet

👨‍💻
Hello old friend!
View GitHub Profile
View gist:132437
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
View gist:132438
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
View gist:137139
import java.io.*;
import javax.swing.*;
import jxl.write.*;
import jxl.*;
public class ExcelTableExporter {
private File file;
private JTable table;
View gist:137144
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)));
}
}
View gist:137140
import java.io.*;
import javax.swing.*;
import jxl.write.*;
import jxl.*;
public class ExcelTableExporter {
private File file;
private JTable table;
View gist:137142
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);
View gist:177166
public class BusinessExpandableListAdapter<T> extends BaseExpandableListAdapter{
private Context contexto;
protected HashMap<String, List<T>> mapList;
}
View gist:177242
@Override
public boolean hasStableIds() {
return true;
}
@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
return true;
}
View gist:177247
//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);