infatti immaginavo.
nel costruttore è presente anche questa riga di codice:
codice:
dframe.getDesktop().setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
E' questa che può dare fastidio?
Passo l'intera classe così possiamo capire se c'è qualcosa che da fastidio
codice:
public class FrameLeague extends JFrame implements ActionListener {
/**
*
*/
static final Logger logger = Logger.getLogger(FrameLeague.class.getName());
private Login log;
private static final long serialVersionUID = 1L;
private DesktopFrame dframe;
public final static int OFFSETX=0;
public final static int OFFSETY=100;
private Dimension screenSize;
public FrameLeague() {
super("Test A");
//Make the big window be indented 50 pixels from each edge
//of the screen.
int inset = 0;
Toolkit kit=Toolkit.getDefaultToolkit();
screenSize = kit.getScreenSize();
ImageIcon smallImg=(ImageIcon)AppResources.getIcon("ballIcon4.gif");
setIconImage(smallImg.getImage());
setBounds(inset, inset, screenSize.width , screenSize.height );
//setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setDefaultCloseOperation(FrameLeague.DO_NOTHING_ON_CLOSE);
dframe=new DesktopFrame();
setContentPane(dframe);
log=new Login(this); //inserimento login
dframe.getDesktop().add(log);
log.setSize(350,160);
log.setLocation((screenSize.width-350-OFFSETX)/2, (screenSize.height-160-OFFSETY)/2 );
log.setVisible(true);
log.setSelected( true );
dframe.getDesktopManager().activateFrame( log );
log.requestFocus();
dframe.getDesktop().setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
this.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
exit();
}
});
}
private void exit(){
int confirmed = JOptionPane.showConfirmDialog(FrameLeague.this,
"Are you sure you want to quit?", "Confirm Quit",
JOptionPane.YES_NO_OPTION);
//Close if user confirmed
if (confirmed == JOptionPane.YES_OPTION)
{
//Close frame
copyDB();
quit();//minimizedInTrayBar();
}
}
....
....
....
}
Può darsi il dframe che alla fine è una classe che eredita da JDesktopPane può dare questo "errore"?