Лабораторная работа 7
This commit is contained in:
parent
672b49e1ec
commit
e1e6a15b1a
@ -289,12 +289,12 @@ public class FormTankConfig {
|
|||||||
canvas.setTransferHandler(
|
canvas.setTransferHandler(
|
||||||
new TransferHandler(){
|
new TransferHandler(){
|
||||||
@Override
|
@Override
|
||||||
public boolean canImport(TransferSupport support) {
|
public boolean canImport(TransferHandler.TransferSupport support) {
|
||||||
return support.isDataFlavorSupported(DataFlavor.stringFlavor);
|
return support.isDataFlavorSupported(DataFlavor.stringFlavor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean importData(TransferSupport support) {
|
public boolean importData(TransferHandler.TransferSupport support) {
|
||||||
if (canImport(support)) {
|
if (canImport(support)) {
|
||||||
try {
|
try {
|
||||||
String data = (String) support.getTransferable().getTransferData(DataFlavor.stringFlavor);
|
String data = (String) support.getTransferable().getTransferData(DataFlavor.stringFlavor);
|
||||||
|
Loading…
Reference in New Issue
Block a user