PDA

View Full Version : [java] sovrapposizione tra JComboBox e sotto


gaglioppo
06-06-2006, 18:03
ciao amici,

una immagine vale molte parole
http://www.francescodesimone.com/shot.gif

è possibile evitare questo brutto effetto di sovrapposizione tra l'apertura di una jcomoBox e quello che c'è sotto?
appure dovrei spostare l'apertura verso sopra, se possibile.

grazie mille 1

franksisca
06-06-2006, 19:52
:confused: :confused: :confused: mai successo, e pure ne ho fatto di grqafica, non è che protesti postare il codice.

gaglioppo
07-06-2006, 07:41
final JComboBox indirizzo;
indirizzo = new JComboBox();
indirizzo.setPreferredSize(new Dimension(350,25));
indirizzo.addItem("http://.ml");
indirizzo.addItem("http://...");
indirizzo.addItem("http://..s/");

indirizzo.setEditable(true);
help.setEditable(false);
pannelloCuore2.add(indirizzo);
....
....
PannelloChk.setPreferredSize(new Dimension(200,150));
PannelloChk.setLayout(new GridLayout(0,1));
JPanel sezione=new JPanel();
sezione.setLayout(new GridLayout(0,1));
sottosez.setVisible(false);
CheckboxGroup cbg = new CheckboxGroup();
tipoPredittore="classico";
final Checkbox chk = new Checkbox("form-->link-->....-->link-->PDB", cbg,true);
chk.setFocusable(false);
final Checkbox chk2 = new Checkbox("form-->email-->PDB", cbg,false);
chk.addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent arg0) {
tipoPredittore="classico";
sottosez.setVisible(false);
sottosez.setOpaque(false);
emailMittente.setEnabled(false);
emailMittente.setEditable(false);
}
});
sezione.add(chk);
CheckboxGroup cbga = new CheckboxGroup();
final Checkbox chk1a = new Checkbox("allegato file .pdb", cbga,true);
final Checkbox chk2a = new Checkbox("testo email = file.pdb", cbga,false);
final Checkbox chk3a = new Checkbox("testo email --> link --> file .pdb", cbga,false);
chk2.addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent arg0) {
sottosez.setVisible(true);
emailMittente.setEnabled(true);
emailMittente.setEditable(true);
tipoPredittore="email_allegato";
//sottoselezione
chk1a.addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent arg0) {
tipoPredittore="email_allegato";
}
});

chk2a.addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent arg0) {
tipoPredittore="email_testo";
}
});

chk3a.addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent arg0) {
tipoPredittore="email_link";
}
});
}
});
sezione.add(chk2);
sottosez.setPreferredSize(new Dimension(200,68));
sottosez.setLayout(new GridLayout(0,1));
//sottosez.add(new JLabel(" "));
sottosez.add(chk1a);
//sottosez.add(new JLabel(""));
sottosez.add(chk2a);
//sottosez.add(new JLabel(" "));
sottosez.add(chk3a);
PannelloChk.add(sezione);
PannelloChk.add(sottosez);
pannelloCuore2.add(PannelloChk);

PannelloChk.revalidate();
pannelloCuore2.revalidate();