/**
*
* @author Hector Rodriguez
*/
package com.zazil.dwh.app.test;
import java.awt.HeadlessException;
import javax.swing.JScrollPane;
import javax.swing.JTable;
public class Ventana extends javax.swing.JFrame {
private JTable tablaP;
/**
* Creates new form Ventana
*/
public Ventana() {
initComponents();
}
public Ventana(JTable tablaP, String title){
super(title);
this.setSize(300, 300);
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
this.tablaP = tablaP;
this.iniciarComponentes(tablaP);
this.setVisible(true);
}
private void iniciarComponentes(JTable tabla){
this.getContentPane().setLayout(null);
JScrollPane jsp = new JScrollPane(tabla);
tabla.setFillsViewportHeight(true);
this.add(jsp);
//this.add(tabla);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
jButton1.setText("jButton1");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(46, 46, 46)
.addComponent(jButton1)
.addContainerGap(281, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(60, 60, 60)
.addComponent(jButton1)
.addContainerGap(217, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
// End of variables declaration//GEN-END:variables
}