Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-19-2008, 03:02 PM
smartsubroto's Avatar
Member
 
Join Date: May 2008
Location: India,Kolkatta
Posts: 50
Rep Power: 0
smartsubroto is on a distinguished road
Send a message via Yahoo to smartsubroto
Default Disable Drag mode of Jinternal Frame
Hi all,

I just need a code so that i can disable the drag mode of JinternalFrame.
Please help..

Thanks in advance..
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 06-20-2008, 12:39 AM
hardwired's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 1,577
Rep Power: 4
hardwired is on a distinguished road
Default
Check the DesktopManager interface.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 06-20-2008, 07:52 AM
smartsubroto's Avatar
Member
 
Join Date: May 2008
Location: India,Kolkatta
Posts: 50
Rep Power: 0
smartsubroto is on a distinguished road
Send a message via Yahoo to smartsubroto
Default
Hi Hardwired,
thanks for your reply.

i checked the DestopManager interface but i haven't find any method to lock the drag mode of JinternalFrame..
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 06-20-2008, 07:15 PM
Niveditha's Avatar
Senior Member
 
Join Date: May 2008
Posts: 307
Rep Power: 2
Niveditha is on a distinguished road
Send a message via Skype™ to Niveditha
Default Hi
check the following code...

it may help u out..

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.plaf.basic.*;

public class InternalFrameUnMovable extends JFrame
{
JDesktopPane desktop;

public InternalFrameUnMovable()
{
desktop = new JDesktopPane();
getContentPane().add( desktop );

desktop.add( createInternalFrame(1, Color.RED) );
desktop.add( createInternalFrame(2, Color.GREEN) );
desktop.add( createInternalFrame(3, Color.BLUE) );
}

private JInternalFrame createInternalFrame(int number, Color background)
{
JInternalFrame internal =
new JInternalFrame( "Frame" + number, true, true, true, true );
internal.setBackground( background );
internal.setVisible( true );
int location = 50 * number;
internal.setBounds(location, location, 300, 300);
return internal;
}

public static void main(String args[])
{
InternalFrameUnMovable frame = new InternalFrameUnMovable();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.setSize(600, 600);
frame.setLocationRelativeTo( null );
frame.setVisible(true);

// Activate first internal frame

try
{
JInternalFrame[] frames = frame.desktop.getAllFrames();
frames[0].setSelected(true);
}
catch (java.beans.PropertyVetoException e) {}

// Make first internal frame unmovable

JInternalFrame[] frames = frame.desktop.getAllFrames();
JInternalFrame f = frames[0];
BasicInternalFrameUI ui = (BasicInternalFrameUI)f.getUI();

Component north = ui.getNorthPane();
MouseMotionListener[] actions =
(MouseMotionListener[])north.getListeners(MouseMotionListener.class);

for (int i = 0; i < actions.length; i++)
north.removeMouseMotionListener( actions[i] );

}
}
__________________
To finish sooner, take your own time....
Nivedithaaaa
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 06-23-2008, 08:21 AM
smartsubroto's Avatar
Member
 
Join Date: May 2008
Location: India,Kolkatta
Posts: 50
Rep Power: 0
smartsubroto is on a distinguished road
Send a message via Yahoo to smartsubroto
Default Wow, ITs Working..
Hi Niveditha,

Thanks alot. Its really work.

Thankyou Niveditha..
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable Radio button AJG New To Java 0 04-07-2008 09:37 PM
Drag and drop abhivenugopal JavaServer Pages (JSP) and JSTL 0 01-30-2008 03:10 PM
disable parent window ismailsaleh AWT / Swing 1 01-08-2008 12:15 AM
Disable BACK and CANCEL buttons in wizard consutes SWT / JFace 2 11-12-2007 10:37 PM
Is it possible to disable drop in a component? Ada AWT / Swing 3 06-07-2007 06:52 PM


All times are GMT +2. The time now is 04:40 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org