codice:
private void priorità() throws SQLException{
controllo="priorità";
// Caricamento dei dati della tabella Doc_di_Prodotto
l=s.selectFromGrafica("priorità");
l.inizio();
Container contentPane=getContentPane();
GridBagLayout gbl=new GridBagLayout();
JPanel jp3=new JPanel();
jp3.setLayout(gbl);
JLabel lcodcf=new JLabel("Codice Cliente: ");
fcodcf=new JTextField(l.restituisciCodCf(),10);
JLabel lnomtab=new JLabel("Nome Tabella: ");
fnomtab=new JTextField(l.restituisciNomArt(),15);
JLabel lpriorità=new JLabel("Priorità: ");
fpriorità=new JTextField(""+l.restituisciNumSta()+"",10);
JButton bfirst=new JButton("First Record");
JButton bnext=new JButton("Next Record");
JButton bprev=new JButton("Prev Record");
JButton blast=new JButton("Last Record");
JButton banew=new JButton("New Record");
JButton badel=new JButton("Delete Record");
JButton basave=new JButton("Save Record");
GridBagConstraints gbc=new GridBagConstraints();
gbc.fill=GridBagConstraints.NONE;
gbc.anchor=GridBagConstraints.CENTER;
gbc.weightx=200;
gbc.weighty=50;
jp3.add(bfirst,gbc,0,0,1,1);
jp3.add(bprev,gbc,1,0,1,1);
jp3.add(bnext,gbc,2,0,1,1);
jp3.add(blast,gbc,3,0,1,1);
jp3.add(banew,gbc,1,3,1,1);
jp3.add(badel,gbc,2,3,1,1);
jp3.add(basave,gbc,1,4,2,1);
gbc.fill=GridBagConstraints.NONE;
gbc.anchor=GridBagConstraints.CENTER;
gbc.weightx=200;
gbc.weighty=50;
jp3.add(lcodcf,gbc,0,1,1,1);
jp3.add(lnomtab,gbc,1,2,1,1);
jp3.add(lpriorità,gbc,2,1,1,1);
gbc.fill=GridBagConstraints.NONE;
gbc.anchor=GridBagConstraints.CENTER;
gbc.weightx=200;
gbc.weighty=50;
jp3.add(fcodcf,gbc,1,1,1,1);
jp3.add(fnomtab,gbc,2,2,1,1);
jp3.add(fpriorità,gbc,3,1,1,1);
bfirst.addActionListener(this);
bprev.addActionListener(this);
bnext.addActionListener(this);
blast.addActionListener(this);
banew.addActionListener(this);
basave.addActionListener(this);
badel.addActionListener(this);
setContentPane(jp3);
validate();
}//[M] priorità
Ho provato ad agguingere i componenti sia in un JPanel che in un JFrame e poi aggiungere questo al setContentPane ma mi da errore ma non capisco il xchè