Remove Focus from Main Frame after Jinternal Frame is opened.

Hi,
I want to restrict the user to change any thing on main frame once the JInternalFrame is opened (you can see same effect when we execute JOptionPane where focus on main is not retain untill you close the JOptionPane).
I have written following code to listen the JInternalFrame event
conn_prop.addInternalFrameListener(new InternalFrameListener(){
@Override
public void internalFrameActivated(InternalFrameEvent e) {
// TODO Auto-generated method stub
@Override
public void internalFrameClosed(InternalFrameEvent e) {
// TODO Auto-generated method stub
@Override
public void internalFrameClosing(InternalFrameEvent e) {
// TODO Auto-generated method stub
@Override
public void internalFrameDeactivated(InternalFrameEvent e) {
// TODO Auto-generated method stub
@Override
public void internalFrameDeiconified(InternalFrameEvent e) {
// TODO Auto-generated method stub
@Override
public void internalFrameIconified(InternalFrameEvent e) {
// TODO Auto-generated method stub
@Override
public void internalFrameOpened(InternalFrameEvent e) {
// TODO Auto-generated method stub
}}); I tried setEnabled(false) but this is paralyzing entire application
what piece of code should i write to do that........
thanks in advance.

That is not how a JInternalFrame is meant to be used. Read the Swing tutorial on "Using Internal Frames".
Use a modal JDialog.

Similar Messages

  • How to keep notification window from stealing focus from main AIR window

    Hi,
    We have an AIR (JavaScript based) chat application that uses the technique posted at the following link to display a notiifcation window each time the user receives a new message.  The notification window gradually fades away after 5 seconds.
    http://cookbooks.adobe.com/post_Creating_a_transparent_notification_window-8226.html
    The technique uses HTMLLoader.createRootWindow to create and display the notification window.
    The issue we are having is that the notification window steals/removes focus from the main AIR window, which is annoying if you are in the middle of typing a message that you want to send to other users.  Once the notification fades away, focus is returned to the main AIR window.
    I searched the AIR documentation to see if there is a way to keep the notification window from stealing focus, but came up empty.  I'm hoping I'm overlooking something.  Can anyone help out?
    Thanks,
    Denis

    Ahmed if i did recognize ur question then...
    Pls Follow this...
    1 - Create New Menu Item Called Window it's properties > Menu Item Type = Magic
    2- Menu Item Type = Magic.
    3- Change Magic Item = Window
    4- Command Type = Null.
    5.Visible In Menu = Yes.
    6.Under Physical 's node >Visible = No.
    Hope this helps...
    Regards,
    Amatu Allah

  • [Flex 4.5.1] How to remove focus from TextInput on mouse click outside of it?

    For me clicking outside of a TextInput should always remove focus from it, only only if you click on another TextInput or Button.
    I don't see any simple event like MouseEvent.MOUSE_CLICK_OUTSIDE - which would definitely simplify things.. I wonder why there isn't such event. Well anyway I can't find any other similar event and I can't figure out an easy way to do this. I also wonder why I couldn't find a solution to this on the web easily... Well anyway...
    Does someone know how to do that in a convenient way?
    Thanks!

    ok I understand why is that. For example I have a TextInput now where the user enters number through buttons which have mouseFocusEnabled = false, so the TextInput doesn't lose focus. But on a TabBar I had to set mouseFocusEnabled = true or when I switched between tabs -> switches between states, I could still type in the TextInput in the previous tab cause it didn't lose focus. Maybe TabBar's default value of that property is wrongly set to false.
    Anyway, not losing focus when clicking outside is still weird. Take for example this forum, if I click outside of the box I am currently writing this, I lose focus. It's how things usually work. And flex focus is designed to work backwards to what people are used to, no matter as I already pointed out I understand there are cases it comes in handly. I hope I don't sound bad but take it just as a suggestion please that maybe if it is redesigned like this: clicking on component gets focus, clicking outside loses focus. But if you click on a button for example and you want to keep the focus on a TextInput cause you add some text, you should be able to set a property on the Button like maintainCurrentFocus = true (false by default), which would make clicking on the Button not shift the focus to it or set it to null if the component is a group that has some rect background for example, but maintain the focus on the TextInput.
    I could be missing something about the current design of how the focus works in flex, but from my point of view at the moment, the design I describe to use is just like how I am usually used to be working with focus as a user, not as developer.
    Maybe you could agree or maybe you know some reason by which things are how they are at the moment that I don't see. But if you think I make sense please let me know, maybe I could fill a minor enhancement request for that ?

  • Remove password from main user account on os x 10.8

    How do i remove password from main user account on os x 10.8
    Thank you
    John

    http://support.apple.com/kb/HT1274

  • How to remove focus from a Ring Control in a PDA application?

    Hello,
        In a PDA application, i have observed that when we select a pull-down Ring control, the focus is retained in the control and the text of the control appears highlighted. The only way out is to tap an empty portion of the PDA application screen to remove focus from the control. Is there any way to avoid this? Is there a method to remove focus from the control programatically?
    Note: Version of LabVIEW that we are using: LabVIEW 8.5 Professional Development System for Windows Vista/XP/2000 and LabVIEW 8.5 PDA Module for Windows Mobile.
    Thanks & Regards,
    Subhashini

    Hi Vsh,
        Thanks for ur response. Setting the key focus property node of the ring control to false removed the focus from the control. I guess it was a silly question (have started LabVIEW devp. recently).
    Thanks & Regards,
    Subhashini

  • Remove focus from JButton?

    I am starting a new thread related to my previous thread.
    I came to realize that when I call a game object from the GUI menu by clicking on "New Game" button, the focus is set to the button. I found it by using the method, if(newButton.hasFocus()).
    However, my problem is not yet finished. I tried game.requestFocus(); also.
    But still, the focus is not removed.
    Can n e one pls let me know if there is a way to remove focus from the damn button?
    Thanks.                         

    button.setFocusable( false );Will pevent the button from maintaining focus.

  • How do I remove MobileMe from iPhone Mailboxes after upgrading to iCloud.

    How do I remove MobileMe from iPhone Mailboxes after upgrading to iCloud. I now have both a MobileMe and iCloud mailbox in Mail in iOS5, but in Mail,Contacts, Calendars there is no MobileMe account to delete!

    check this https://discussions.apple.com/message/16371039#16371039

  • HT1222 How do I remove apps from staying alive after using them so as to reduce battery usage?

    How do I remove apps from staying alive after using them so as to reduce battery usage?

    double click the home button and swipe the app window up and off of the screen

  • HT5919 How do I remove apps from App Store after update in IOS7?

    After app update, all app icons are remaining in App Store. Is there a way to remove the icons as in iOS 6?

    There is no way to remove apps from your purchase history. It simply cannot be done. You can HIDE apps from the purchased tab, but you can NEVER delete them.
    iTunes Store: Hiding and unhiding purchases - Support - Apple
    As for the updates not clearing, try closing the App Store app and reboot your iPad,
    Go to the home screen first by tapping the home button. Double tap the home button and the recents tray will appear with all of your recent apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button or anywhere above the task bar.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Removing focus from a node

    I have a frame in which a scrollpane hold a jtree.
    I picked up the following code from the forum for making sure that only when the right click is on a node, the popupmenu is displayed.
    public void mouseReleased(MouseEvent e) {
                if (e.getButton() == MouseEvent.BUTTON3) {
                    TreePath closestTreePath = tree.getClosestPathForLocation(e.getPoint(), e.getPoint());
                    if (closestTreePath != null) {
                        tree.setSelectionPath(closestTreePath);
                         // select the row in the tree for the path
                        selectedRow = tree.getRowForPath(closestTreePath);
                        YourNode node = (YourNode) closestTreePath.getLastPathComponent();
                       // assuming your popup menu is already created somewhere else
                       popupMenu.show(deviceTree, pt.x, pt.y);
                        selectedRow = -1;
    }by codecraig
    But now the problem is that whenever i do right click anywhere on the tree a node gets selected and the popupmenu is displyed. i want to display the right click is on the node.
    here is my code
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.event.*;
    public class tree_right_click
         //JPopupMenu popupmenu = new JPopupMenu();
         JTree mytree;
         SysPopupListener s = new SysPopupListener();
         public tree_right_click()
              DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
              DefaultMutableTreeNode l1 = new DefaultMutableTreeNode("level1");
              DefaultMutableTreeNode l2 = new DefaultMutableTreeNode("level2");
              mytree=new JTree(root);
              mytree.addMouseListener(s);
              root.add(l1);
              l1.add(l2);
              JScrollPane treeview = new JScrollPane(mytree);
              JFrame fr = new JFrame("My Frame");
              fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              fr.getContentPane().add(treeview);
              fr.setSize(300,300);
              fr.setVisible(true);
              public static void main(String args[])
              new tree_right_click();
    class SysPopupListener extends MouseAdapter
         JPopupMenu popupmenu = new JPopupMenu();
         SysPopupListener()
              JMenuItem part = new JMenuItem("Add detail 1");
              JMenuItem part2 = new JMenuItem("Add detail 2");
              part.addMouseListener(this);
              part2.addMouseListener(this);
              popupmenu.add(part);
              popupmenu.add(part2);
         public void mousePressed(MouseEvent e)
              maybeshowpopup(e);
         public void mouseReleased(MouseEvent e)
              maybeshowpopup(e);
         void maybeshowpopup(MouseEvent e)
              if(e.isPopupTrigger())
                   JTree t = (JTree)e.getComponent();
                   TreePath closestTreePath = t.getClosestPathForLocation(e.getX(), e.getY());
                if (closestTreePath != null) {
                    t.setSelectionPath(closestTreePath);
                     // select the row in the tree for the path
                    int selectedRow = t.getRowForPath(closestTreePath);
                    DefaultMutableTreeNode n = (DefaultMutableTreeNode) closestTreePath.getLastPathComponent();
                    System.out.print(n);
                   // assuming your popup menu is already created somewhere else
                    popupmenu.show(e.getComponent(),e.getX(),e.getY());
                    selectedRow = -1;
    }Please help,
    thanks in advance,
    Puneet

    I made some changes to your code and seems to be working like this:
              if(e.isPopupTrigger()) {
                   JTree t = (JTree)e.getComponent();
                   TreePath closestTreePath = t.getClosestPathForLocation(e.getX(), e.getY());
                   if (closestTreePath != null) {
                        t.setSelectionPath(closestTreePath);
                        // select the row in the tree for the path
                        int selectedRow = t.getRowForPath(closestTreePath);
                        DefaultMutableTreeNode n = (DefaultMutableTreeNode) closestTreePath.getLastPathComponent();
                        System.out.print(n);
                        // assuming your popup menu is already created somewhere else
                        popupmenu.show(e.getComponent(),e.getX(),e.getY());
                        selectedRow = -1;
                   JTree t = (JTree)e.getComponent();
                   TreePath path = t.getPathForLocation(e.getX(), e.getY());
                   if (path != null) {
                        popupmenu.show(e.getComponent(),e.getX(),e.getY());
              }

  • Remove focus from combobox

    Hi,
    Iam working with SAP B1 2007 .
    A combobox is populated with items.After the user selects the item in it,the focus must be removed from that combobox control to next textbox control.Can anyone suggest me what can I do for this.
    Thanks In Advance

    Hi ,
    Catch the event combo select and then emulate a click on the text control
    using
    oform.Items.Item("textControl").Click
    regards
    Edy

  • How do I remove photos from memory card after I have uploaded photos?

    We have iPhoto 11.  How do delete photos from a memory card after they have been uploaded in to iPhoto?
    Thanks.

    delete the iPhoto preference file
    HOWEVER a best practice to is to never have any computer program (including iPhoto) delete the photos from the card but to import the photos and keep them and then after at least one successful backup cycle has completed and then reformat the card --  I use three very large (32 GB) cards in rotation so I do not reformat for typically a year or more giving me one more long term backup of my photos
    If you continue letting the computer delete your photos you will lose them sooner or later
    You pays your money and makes your choice - but you are playing a very risky game with no rewards
    LN

  • Removing music from iphone 4s after the update

    How do I remove music that appeared in my iphone 4s after the ios7 update? There are songs on here that my kids have downloaded on their accounts and also songs that I erroneously downloaded but can't delete. I tried dragging the song but no delete button appears for the songs purchased in itunes. I can only delete songs that were added via CD. These songs don't show up in my purchased songs on itunes on my computer, they are only in my phone.

    Uncheck autofill and go to the music tab and select whatever you want.

  • How to remove document from Flash drive after printing from a PC

    Hi All,
    Here's my problem: Today I needed to print an MS Word file at a printshop, so I saved the document onto my Flash drive and took it to the shop. There, the staff printed the document from a PC and handed the drive back to me.
    Now, back at home, I want to delete this document from the Flash Drive. I plug in the drive, select the document and drag it to the trash. But then I get this message: " The operation cannot be completed because you do not have sufficient privileges for document X".
    This is a document I created from scratch, so I should have read/write privileges, yet the document on the drive is Read Only.
    I went back to the shop, and they get the same message.
    If I try to use disk utility to erase the disk, it appears as an MS-DOS FIle System (FAT 16) disk, and the erase buttons are "greyed out".
    How can I erase this document? Or how I can I reformat the drive?
    Any help much appreciated!~
    12 iBook G4,1.2 GHz, 768 RAM   Mac OS X (10.4.7)  

    I think I just solved my own problem. Just tried pressing the option and command keys at the same time while dragging the document into the trash and now it's gone. For good, I hope....Phew!
    12 iBook G4,1.2 GHz, 768 RAM   Mac OS X (10.4.7)  

  • Table somehow "removed" itself from main table.

    I am a novice and have learned the basics of html in order to update my company's website and add new pages as they become necessary.  In order to add the new pages, I have basically copied and pasted the code into DW, deleted the parts I don't need and added in the new stuff.  I needed to add a link to a line of links at the bottom of the page, went through each page and put in identical code.  The site has about 10 pages, and all but one look the way they should.  Everything else looks great.
    The one that went rogue has a footer which is in a larger font, is way over to the left (even though everything else is centered), and the line that runs across the top of this area (a .jpg) is too short.  I have checked and checked the code and compared to other correct pages, and can not find a difference.  The only difference I can see is when I view the split screen, and in the design view the main table (normally) will extend to the bottom of the page and the table which contains the footer is inside of this.  On the one rogue page, the footer is below the main table and I can not seem to be able to get it to go back into the main table.
    So I have two questions:
    1)  The "drag and drop" only deletes the code as far as I can tell, so how do I get this footer back into the main table (which is justified correctly)?
    2)  I am anticipating a lot of "add the code inside the table" responses, but I can not figure out which tags deal with which tables (this is part of the problem I think).  Is there a way to search the code in DW and find only the related tags?  (ie. if I find a </table> tag can I search for the <table> tag that corresponds to this without having to print out and search through the code by hand?)
    Any help would be greatly appreciated!  If you need additional information, I will do my best to provide it.
    Thank you,
    dingophil

    1)  The "drag and drop" only deletes the code as far as I can tell, so how do I get this footer back into the main table (which is justified correctly)?
    By placing the code back into the table! 8)  This is where a knowledge of HTML (and ultimately CSS is absolutely essential).  However a bit of knowledge about DW can help alot.  For example if you click in one of the table cells in design view, then click on the right-most <table> tag on the Tag Selector (at the bottom of the document pane), you will see all the code for THAT TABLE highlight.  This gives you a way to easily find which <table> tag belongs where.  But I'm not sure what you mean by 'only deletes the code' in your comment above - if you mean that dragging and dropping somehow deletes code then you are mistaken.
    The best way to solve your problem here would be to post a link to the recalcitrant page so we can see it and its code.  You'll have your answer in a jiffy.

Maybe you are looking for