AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Popup alla pressione di un tasto

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian)
View previous topic :: View next topic  
Author Message
godmetal@tiscali.it
Guest





PostPosted: Mon May 21, 2007 4:04 pm    Post subject: Popup alla pressione di un tasto Reply with quote



Buongiorno a tutti
sto creando un mio oggetto che deve avere questa funzione.
E' un pannello che ha una text field e una label e una finestra popup
con all'interno una tabella che ha due campi. A seconda della riga
cliccata , la textfield prende il valore della prima colonna e la
label quello della seconda.
Il problema è che il click sulla tabella della finestra di popup non
viene intercettato dal listener.

public class MySearchTextField extends JPanel{
private JLabel label;
private JTextField field;
private MyTable table;
private JFrame popup;

public MySearchTextField() {
setPreferredSize(new java.awt.Dimension(179, 19));
setLayout(null);
field = new javax.swing.JTextField();
label = new javax.swing.JLabel();
table = new MyTable();
add(field);
add(label);
field.setBounds(0, 0, 70, 19);
label.setBounds(80, 0, 140, 14);

popup = new JFrame("ricerca");
popup.setLayout(new FlowLayout());
popup.add(table);
popup.setBounds(0,0,64,19);
popup.setVisible(true);
}

public void addListener(MouseListener msfl){ // il metodo è
publico e registra un oggetto privato
table.addMouseListener(msfl);
}
}
//----------------------------------
Questo è il listener
public class MySearchFieldListener implements MouseListener{


public void mouseClicked(MouseEvent e) {
System.out.println("cliccato");


}

// implementazione altri medodi astratti
}

Chi può aiutarmi?
grazie
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.