import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
public class FrameProva extends JFrame {
private JTable tabella;
private JScrollPane scrollPane;
public FrameProva() {
super("Prova");
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(500, 400);
setLocationRelativeTo(null);
tabella = new JTable(100, 12); // esempio di 100 righe x 12 colonne
scrollPane = new JScrollPane(tabella);
add(scrollPane);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new FrameProva().setVisible(true);
}
});
}
}