JInternalFrame

Miki
25 de Septiembre del 2005
Puedo poner un JInternalFrame dentro una aplicacion, y que no se pueda mover?

Rockdrigo
25 de Septiembre del 2005
Hola, aqui tienes un codigo con un internal frame que no se mueve

import javax.swing.*;
import javax.swing.plaf.metal.*;

public class noMoveJinternalframe {
public static void main(String[] args) {
JFrame f = new JFrame("No move internal frame -- by T55555");
JInternalFrame ff = new JInternalFrame("No move", true, true, true, true);//
ff.setSize(200, 100);
ff.setLocation(50, 50);
ff.setVisible(true);
ff.setUI(new MetalInternalFrameUI(ff) {
private JComponent titlePane;
protected JComponent createNorthPane(JInternalFrame f) {
titlePane = super.createNorthPane(f);
return titlePane;
}
public void installUI(JComponent c) {
super.installUI(c);
titlePane.removeMouseMotionListener(titlePane.getMouseMotionListeners()[0]);
}
});
JDesktopPane pane = new JDesktopPane();
pane.add(ff);
f.setContentPane(pane);
f.setSize(300, 250);
f.setLocationRelativeTo(null);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
}


la clave esta en
ff.setUI(new MetalInternalFrameUI(ff)
Saludos!!
corporative solitions.