Making JInternalFrame dragging perform faster

You can set the client property JDesktopPane.dragMode to specify how internal frames are shown when dragged.

null (default): the entire JInternalFrame is shown
outline: only a rectangle is shown
faster: a more efficient implementation of the default

Main.java:

import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
import java.net.*;
 
public class Main extends JFrame {
   JDesktopPane desktop;
   int nframes = 0;

   public Main() {
      desktop = new JDesktopPane(); 
      createInternalFrame(); 
      setContentPane(desktop);
      setJMenuBar(createMenuBar());
   }

   protected JMenuBar createMenuBar() {
      JMenuBar menuBar = new JMenuBar();

      JMenu menu1 = new JMenu("Create");
      menu1.setMnemonic(KeyEvent.VK_C);
      JMenuItem menuItem1 = new JMenuItem("New");
      menuItem1.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent ae) {
            createInternalFrame();
         }
      }); 
      menuItem1.setMnemonic(KeyEvent.VK_N);
      menu1.add(menuItem1);
      menuBar.add(menu1);
 
      JMenu menu2 = new JMenu("Dragging");
      menu2.setMnemonic(KeyEvent.VK_D);

      final JRadioButtonMenuItem defaultDraggingItem = new JRadioButtonMenuItem("Default");
      final JRadioButtonMenuItem outlineDraggingItem = new JRadioButtonMenuItem("Outline");
      final JRadioButtonMenuItem fasterDraggingItem = new JRadioButtonMenuItem("Faster");
      Action draggingAction = new AbstractAction() {
         public void actionPerformed(ActionEvent ae) {
            if (defaultDraggingItem.isSelected())
               desktop.putClientProperty("JDesktopPane.dragMode", null);
            else if (outlineDraggingItem.isSelected())
               desktop.putClientProperty("JDesktopPane.dragMode", "outline");
            else if (fasterDraggingItem.isSelected())
               desktop.putClientProperty("JDesktopPane.dragMode", "faster");
         }
      };
      defaultDraggingItem.addActionListener(draggingAction);
      outlineDraggingItem.addActionListener(draggingAction);
      fasterDraggingItem.addActionListener(draggingAction);
      menu2.add(defaultDraggingItem);
      menu2.add(outlineDraggingItem);
      menu2.add(fasterDraggingItem);
      ButtonGroup group = new ButtonGroup();
      group.add(defaultDraggingItem);
      group.add(outlineDraggingItem);
      group.add(fasterDraggingItem);

      menuBar.add(menu2);     

      return menuBar;
   }

   public void actionPerformed(ActionEvent e) {
      System.out.println("Now creating internal frame!");
   }
 
   protected void createInternalFrame() {
      JInternalFrame frame = new JInternalFrame("InternalFrame", 
         true,    // resizable
         true,    // closable
         true,    // maximizable
         true);   // iconifiable
      frame.setVisible(true); 
      desktop.add(frame);
      frame.setSize(200, 200);
      frame.setLocation(30*nframes, 30*nframes);
      nframes++;
      try {
         frame.setSelected(true);
      } catch (java.beans.PropertyVetoException e) {}
   }
 
   public static void main(String []args) {
      Main main = new Main();
      main.setSize(500, 300);
      main.setVisible(true);
   }
}