我有这个标签:
//---- label5 ----
label5.setText("Drag and drop your texture\npack in the box *.zip files");
label5.setIcon(new ImageIcon(
"E:\\Chituri\\MBMLauncherJava\\src\\resursele\\dasdasdasd.png"));
但我想做这样的事情:
//---- label5 ----
label5.setText("Drag and drop your texture\npack in the box *.zip files");
label5.setIcon(new ImageIcon(
"E:\\Chituri\\MBMLauncherJava\\src\\resursele\\dasdasdasd.png"));
// drag files in the label >
// automatically move files in particular folder (E:\\Chituri)
我怎么能做到这一点?
我试试这个...
label5.setTransferHandler(transfer);
label5.addMouseListener(new MouseAdapter(){
public void mousePressed(MouseEvent e){
JLabel texturidrag = (JLabel)e.getSource();
TransferHandler handle = texturidrag.getTransferHandler();
handle.exportAsDrag(texturidrag, e, TransferHandler.COPY);
}
});