Skip to content

Instantly share code, notes, and snippets.

View necronet's full-sized avatar
👨‍💻
Hello old friend!

Jose Ayerdis necronet

👨‍💻
Hello old friend!
View GitHub Profile
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
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
import java.io.*;
import javax.swing.*;
import jxl.write.*;
import jxl.*;
public class ExcelTableExporter {
private File file;
private JTable table;
import java.io.*;
import javax.swing.*;
import jxl.write.*;
import jxl.*;
public class ExcelTableExporter {
private File file;
private JTable table;
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);
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)));
}
}
w.write();
public class BusinessExpandableListAdapter<T> extends BaseExpandableListAdapter{
private Context contexto;
protected HashMap<String, List<T>> mapList;
}
public class CustomExpandableListAdapter<T> extends BaseExpandableListAdapter{
private Context contexto;
protected HashMap<String, List<T>> mapList;
public CustomExpandableListAdapter(Context contexto,HashMap<String, List<T>> mapList) {
this.mapList=mapList;
this.contexto=contexto;
}
@Override
public T getChild(int groupPosition, int childPosition) {
T value=mapList.get(getMapGroup(groupPosition)).get(childPosition);
return value;
}
@Override
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}