}
});
}
+ }
+ this.setDropTarget(new java.awt.dnd.DropTarget(desktopPane, this));
- this.setDropTarget(new java.awt.dnd.DropTarget(desktopPane, this));
-
- this.addWindowListener(new WindowAdapter()
+ this.addWindowListener(new WindowAdapter()
+ {
+ @Override
+ public void windowClosing(WindowEvent evt)
{
- @Override
- public void windowClosing(WindowEvent evt)
- {
- quit();
- }
- });
+ quit();
+ }
+ });
- MouseAdapter ma;
- this.addMouseListener(ma = new MouseAdapter()
+ MouseAdapter ma;
+ this.addMouseListener(ma = new MouseAdapter()
+ {
+ @Override
+ public void mousePressed(MouseEvent evt)
{
- @Override
- public void mousePressed(MouseEvent evt)
+ if (evt.isPopupTrigger()) // Mac
{
- if (evt.isPopupTrigger()) // Mac
- {
- showPasteMenu(evt.getX(), evt.getY());
- }
+ showPasteMenu(evt.getX(), evt.getY());
}
+ }
- @Override
- public void mouseReleased(MouseEvent evt)
+ @Override
+ public void mouseReleased(MouseEvent evt)
+ {
+ if (evt.isPopupTrigger()) // Windows
{
- if (evt.isPopupTrigger()) // Windows
- {
- showPasteMenu(evt.getX(), evt.getY());
- }
+ showPasteMenu(evt.getX(), evt.getY());
}
- });
- desktopPane.addMouseListener(ma);
- }
+ }
+ });
+ desktopPane.addMouseListener(ma);
} catch (Throwable t)
{
t.printStackTrace();