| Author |
getting the dropped event problem
|
Punit Jain
Ranch Hand
Joined: Aug 20, 2011
Posts: 908
|
|
can anyone tell me how can i get the string/value of a droppable JTextfield, I mean, i have a text field and some JLabels, i m dropping the JLabels into textfield, nd i want, whatever the label i dropped i want to get/store that string/value, in a variable, how can i do this??
i did somthing like this, bt it's nt working:
class TextHandler implements ActionListener {
public void actionPerformed(ActionEvent evt) {
String disp = evt.getActionCommand();
JOptionPane.showMessageDialog(null, disp);
System.out.println(disp);
}
}
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32833
|
|
|
What is wrong with this?
|
 |
Punit Jain
Ranch Hand
Joined: Aug 20, 2011
Posts: 908
|
|
Campbell Ritchie wrote:What is wrong with this?
No, Actually my question is, whichever the label i dropped into the text field, i want to get that text, nt the label text, how can i do this?
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32833
|
|
Not sure I understand the question, but I know precious little about drag-n-drop. Sorry.
Anybody else?
|
 |
Punit Jain
Ranch Hand
Joined: Aug 20, 2011
Posts: 908
|
|
Campbell Ritchie wrote:Not sure I understand the question, but I know precious little about drag-n-drop. Sorry.
Anybody else?
it's okay Ritchie....
|
 |
 |
|
|
subject: getting the dropped event problem
|
|
|