InputVerify ... ugly shouldYieldFocus when exit dialog or windows

yes, maybe I should just skip InputVerify, but I figure I maybe able to learn somethere here.
I am verifying make sure the jtextfield only has number and it's a required field, everything is okay here. but when I tried to close my dialog it pops up the InputVerify message.
My cancel button uses
buttonCancel.setVerifyInputWhenFocusTarget( false);  of course the dialog didn't have that method
so I tried to search for some idea, but so far I think I had to use override shouldYeildFocus() method, but can I make the jcomponent to see it's a dialog not jtextfield??
This is kinda close.
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=739038
also I tried to add a method QuitListener
protected class QuitListener implements ActionListener, WindowListener {is there a way to disable InputVerifer?
Message was edited by:
ekin_00
add code around setVerifyInputWhenFocusTarget
Message was edited by:
ekin_00

A: InputVerify ... ugly shouldYieldFocus when exit dialog or windows

Works fine in the [url http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html#inputVerification]Input Verification Demo.
I changed the code to display the panel in a dialog instead of the JFrame.
//        frame.setContentPane(newContentPane);
        //Display the window.
        frame.pack();
        frame.setVisible(true);
        JDialog dialog = new JDialog();
        dialog.setContentPane(newContentPane);
        dialog.pack();
        dialog.setVisible(true);And if you add code to display an option pane in the verify method you need to do it like this to get around a bug:
        public boolean verify(JComponent input) {
             boolean value = checkField(input, false);
             if (value == false)
            input.setInputVerifier(null);
            JOptionPane.showMessageDialog(null, //no owner frame
                                          "something is wrong", //text to display
                                          "Invalid Value", //title
                                          JOptionPane.WARNING_MESSAGE);
            input.setInputVerifier(this);
               return value;
//            return checkField(input, false);
        }If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

Works fine in the [url http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html#inputVerification]Input Verification Demo.
I changed the code to display the panel in a dialog instead of the JFrame.
//        frame.setContentPane(newContentPane);
        //Display the window.
        frame.pack();
        frame.setVisible(true);
        JDialog dialog = new JDialog();
        dialog.setContentPane(newContentPane);
        dialog.pack();
        dialog.setVisible(true);And if you add code to display an option pane in the verify method you need to do it like this to get around a bug:
        public boolean verify(JComponent input) {
             boolean value = checkField(input, false);
             if (value == false)
            input.setInputVerifier(null);
            JOptionPane.showMessageDialog(null, //no owner frame
                                          "something is wrong", //text to display
                                          "Invalid Value", //title
                                          JOptionPane.WARNING_MESSAGE);
            input.setInputVerifier(this);
               return value;
//            return checkField(input, false);
        }If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

Similar Messages

  • Is there a way to get firefox to warn me when exiting with multiple windows open?

    When I click File > Exit in the menu, I want firefox to warn me if I have multiple windows open.
    I don't want it to warn me about multiple tabs though.
    Is there a way to get it to do that?
    I would prefer to just hit the red X in the top right corner, which would avoid this problem, However, if it is the only firefox window I have open, then the red X will often not properly shut down firefox exe, so next time I try to launch firefox it won't work and I have to end task on firefox exe! I was told to use File Exit to improve the chances that firefox will properly close, but doing so introduces this new issue.
    thanks

    That doesn't work.
    Once I set it to true, if I have one window open with multiple tabs, and try to exit, it comes up with a warning box, which I don't want.
    Then if I check it to say 'don't show this again', the next time I run firefox the showQuitwarning setting has been set back to false. So then when I have multiple windows open and I file exit, all firefox shuts down with no warning.
    The reason I want this is because I can *see* the tabs of the window I am in when I am clicking on file|exit, so visually, I'm not going to close anything that I didn't mean to close because it's right there visible to me at the top of the screen (the tabs are seen at the top of the screen) in the same area as where I am looking at and clicking File Exit.
    But other firefox windows are not visible up there so it is easy to forget that they are open, since a lot of times I don't have any other windows open (if I *always* had other windows open then I would not forget them and be in more of a practice of checking the taskbar for them)
    And this is all because I can't hit the red X in the top right corner without increasing the odds of hung firefox processes that don't truly exit (thus making me unable to start another session later without Ending Task which isn't good).
    The hanging is daily but random and not reproducible, so it's very difficult to troubleshoot or fix.

  • Photoshop cs6 crashes when moving dialogs and windows

    So recently, Photoshop has started randomly crashing when moving dialogs around or onto 2nd monitor. The files I have open are not large, so I am looking to understand why this is happening. has anyone else experienced this with their application?
    Thanks

    It might be helpful if you'd go into your Windows Event Logs (specifically, the Application log) and look for the Error event indicating a Photoshop crash.  It may identify a module that will help narrow down the problem - though I suspect it will show a crash in the printer driver.  Copy the text and list it here.
    -Noel

  • When I minimize a window, it disappears completely as if I exited it altogether, why?

    After I installed the new update for firefox and i tried out several different themes, I found that when I minimize a window it disappears completely instead of just going down like normal. I wish it didn't do that, I miss the other feature.
    == This happened ==
    Just once or twice
    == This started after I downloaded the update and tried out different themes.

    This worked for me.
    Apparently Firefox sometimes minimizes to a tiny off-screen window. To get it back:
    1. In the taskbar, right-click on Firefox, then left-click "restore"
    2. In the taskbar, right-click on Firefox, then left-click "move"
    3. Use the arrow keys to move the Firefox window until it re-appears.
    4. Once it does, click and drag to enlarge it.
    It should now minimize properly.

  • Error when launching vbscript at windows startup

    I have a thin client running WES 7 Standard trying to launch a powerpoint file without loading the shell(explorer). I've done this with other applications like IE and Citrix Apps but am getting an error that I don't understand. Below is the script i'm using.
    Set WshShell = Wscript.CreateObject("WScript.Shell")
    CMD = "C:\slideshow.pptx /F"
    strComputer = "."
    WshShell.Run CMD,3,True
    Do While (1)
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colProcesses = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = 'pptview.exe'")
    If colProcesses.Count = 0 Then
    WshShell.Run CMD,3,True
    End If
    Wscript.Sleep (2000)
    Loop
    I've tried various combinations in the CMD field for launching the file. These include using a batch file to pointing to powerpoint viewer and using the command line switches to launch file. Every method so far gives me error dialog from the viewer saying
    there was an error accessing "the location of the powerpoint file." I have placed this file all over windows and get the same error and even tried this with an administrator account. I suspect it may have to do with the way I am launching this script
    but do not understand why as I can launch it manually and it works no problem.
    I launch the script by modifying the the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit key to point to a userinit.bat file.
    @echo off
    if not exist c:\%username%.lck goto Reg
    Start c:\windows\system32\applaunch.vbs
    exit
    goto End
    :Reg
    start C:\WINDOWS\system32\userinit.exe
    :End
    Exit
    Any ideas why I am getting this error? Any suggested alternatives? I am getting close to conceding and setting it up to launch after explorer loads because this particular machine and it's purpose won't be within easy reach of people accessing it but I do use
    this method for other functions where we do not want explorer access available at all. i.e no start menu/taskbar loaded

    What you are trying to do is not supported on Windows.
    You mention a thin client.  This has nothing to do with thin clients.  Thin clients are just dumb monitors that run a remote RDP session.
    If you are connecting to a terminal server there is a configuration in GP or in the terminal server configuration that let you specify an alternate shell.  If you are running this as a remote to a workstation then you need to specify the shell in the
    user profile.  THis can be done through group policy or via a registry edit.
    You cannot use a script for this and you cannot use an Office program without Explorer.  Office requires Explorer to run which is why you are getting that error.
    Redirecting userinit for the whole machine will likely create many bad side effects as it is a fundamental process.  It is called multiple times during logon.  Replacing it with a batch file will cause you script to be executed multiple times. 
    Usually userinit is called at least three times.  In a domain with Group Policy it can be called a dozen times.  I am pretty sure the only reason for it being in the registry is to allow for debugging.
    Another this folder.ng to knowis that userinit has to complete before many things in Office will work correctly dependin on you implementation.
    You can load the powerpoint viewer and directly launch that with the file name from the
    "startup"  .  You can also try and set the powerpoint viewer as the alternate shell.  It just might work because it is designed to run completely stand alone with no Office and is used in kiosks which generally run without Explorer. 
    You can also try to use IE to launch the ppt as it can host this with the viewer installed.  It can be set to fullscreen and it will re-launch  when exited just like Explorer does,
    ¯\_(ツ)_/¯

  • When launch w/ Seamless windows, doesn't effectively end session

    To replicate, we are doing the following:
    1) Have users launch MS Visio by clicking a link on our site as follows:
    https://servername.com/sgd/launcher.jsp?o=Write&e=false
    2) And Visio is running as a "Seamless Window"
    The result: when a user closes Visio (clicks the "X" or file>exit application), the windows app server effectively logs out of that terminal services session, but SGD's object manager still shows that the session has been "suspended." Additionally, the taskbar tcc.exe icon is still present. Users then have trouble logging in again, get errors, etc.
    But when we have visio launch in an independent window, and the user closes the app, everything works fine (the taskbar icon goes away and object manager shows that the session has actually closed).
    This means we cannot use seamless windows in this way. Can Sun replicate this, and is there a workaround or a fix planned?
    Thank you

    Had a very similar issue with Linux KDE applications. Appears, we have corrected the issues � the issue was � the parent process forked a process, elevating the child to it's own parent disassociating the forked process, (child) from the parent. When the application was closed with �File close� all was fine, when the applications was closed with the �X� we saw the issue. To correct the issue � we changed the options in the ARRAY relative to �what to due� when the application exits and leveraged a no fork option available within the application. I realize this may not or will not help. But, we started looking at unconventional way's to launch applications and dug very deeply into the options as to how applications can be executed/launched, the options were relative to the application not SGD.

  • Is it advisable to use inheritance when reusing dialogs/frames?

    Hi!
    While working on a project, I've noticed that there are instances when I could reuse code by creating general forms (as dialogs or windows) and subclassing them. For example, I have this set of dialogs which have a similar function: each dialog has a table (or list) of objects and functions for adding, deleting and editing objects in this table. Do you think that it's good to use inheritance in this case? That is, I create a general AddEditDeleteDialog from which to subclass particular dialogs, AddEditDeleteObject1Dialog, AddEditDeleteObject2Dialog, ...
    Thanks!

    Yes, of course. But to what extent? Should I include
    layouting code, component initialization, event
    handling, etc in the superclass (AddEditDeleteDialog),
    or should I let the subclasses (AddEditDeleteObject1Dialog)
    handle that?Basically, whatever is the same in all the subclasses can be placed in the superclass. If there are differences, then you should place it in the subclasses.
    Things like event handling can be placed in the superclass, where each method in the event listener fires an abstract method in the superclass, which each of your subclasses implement to provide custom event handling.
    Component initialization can also be used in the superclass for whatever components are used in all of the subclasses. Subclasses can then add any components which are unique to them.
    You should also be aware that the purpose of inheritance is to add to the functionality of a class. If your subclass provides no extra abstract functionality then you should just use one class, and change some settings each time you need to use it for a different purpose. E.g. If your dialogs contain the same components, same actions etc but different text, then use just one class, and for each dialog, set the text for each of the components accordingly.
    There is no hard/fast rule for using inheritance and how to design an object hierarchy, and as my first programming teacher used to say "every programming problem can usually be solved in loads of different ways."

  • Firefox will close when i close the window but the process doesn't shutdown ever since i had updated to FF25

    I am running Win. 8.1 and had no issues with FF 24. Since upgrading to FF 25, firefox will appear closed when i close the window but the process doesn't shutdown. I have to go into Task Manager to end the process. I can then launch it again.

    SOLUTION (possible).
    Hi all. I had this problem as well. I currently run FF26. A week or so ago, out of nowhere FF wouldn't exit - the window would close but firefox.exe process would keep running in the background using about 50% of CPU. Not sure if it's connected, but just prior to that I clicked on a link on Facebook that looked like spam website, nothing happened, site loaded (sort of, all I saw was a msg - Please Wait...) but nothing happened, I have Eset antivirus and it monitors network traffic and files for viruses, so maybe it prevented my PC getting infected...
    So, I had this problem for a few days, was searching the net for solutions, but nothing seem to help. Then, just out of luck I did something that WORKED!
    Here's what I did. I noticed that svchost.exe was using a lot of CPU alongside with FF. I ran ProcessExplorer to see what might be connected to this process, the list was long and I didn't have any idea where to start, so what I did was - Right click on svchost process, choose Debug and dismiss the warning. In a few seconds svchost process quit and after that FF started closing properly.
    I had to re-enable all my plugins and themes I disabled prior, I also lost my history and preferences which I trashed in the process of searching for solution. But heck, it worked, hopefully for good. Now if someone could point out the real cause of this and fix it for everyone - that would be great. Cheers!

  • DSM Terminator issue -  when exiting, user sees "about blank" screen

    This issue is being experienced by two of our Portal users. When the user exits the portal, they get an "about blank" internet explorer page that is minimized in the Windows taskbar. When viewing the "about blank" page properties, there is no information about the page. It allows you to maximize it into a blank white screen or close it out.  Also, before this page is loaded, when exiting the Portal a quick screen flashes before the Portal screen closes. The screen basically says
    ****Closing sessions... Transmission protocol, DSM Terminator v.6.060 (sync)  (long portal address)   Request PREPARED for sending via client  (Finished 1 request(s) distributed***** 
    Both users experience this issue everytime they exit their Portals. We have tried numerous troubleshooting measures to fix the problem and we've isolated it to their specific computers, not their usernames.  We have had this before and reformatting does fix the issue, but we want to know how to avoid reformatting and just fix the one issue.  We've scanning the computer for spyware/viruses, checked their startup configuration, cleaned temp/temp internet/cookies, tried different user names.  Thanks for your help on this!

    First off the DSM terminator window is completely normal.  This is client side javascript that closes the connection to R3.  This can be run server side if you need it to but doesn't work if the connection is done over SSL. 
    As far as the popup window, I would try and restore the defaul IE settings.

  • Firefox 4 mac. no save tabs when exiting/restarting

    I just upgraded to firefox 4 on my mac.
    I have looked in the preferences for the option to save tabs (multiple tabs) when exiting / restarting firefox.
    I have found info on this for windows but not for os x.
    I love and use this feature extensively. How do I get it back?
    Thanks in advance

    App tabs and Tab Groups (Panorama) are stored as part of the session data in the file sessionstore.js in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder]
    * http://kb.mozillazine.org/Session_Restore
    Make sure that you do not use [[Clear Recent History]] to clear the "Browsing History"

  • Firefox saves user preferences to prefs.js when exit it, is this redundant?

    I have a question regarding to why Firefox saves user preferences to prefs.js when exit it.
    My observation is that Firefox saves changes immediately to prefs.js when users modify preferences either through Option (Windows)/Preferences (Mac, Linux) menu or directly through about:config page. Therefore, the prefs.js file should always in sync with the browser.
    However, I notice that Firefox saves preferences to prefs.js in the end when I exit the browser. I am wondering if this feature is redundant since all preferences are in sync between prefs.js and browser? Or maybe some preferences are not saved immediately? If that is the case, how to identify those preferences that are not saved immediately?
    Thanks in advance!

    It is possible that there are situations where there are some prefs that need to be changed and where the two files differ.<br />
    This can happen if you use Clear Recent History and Firefox wasn't able to complete that task.<br />
    Another possibility is to restart Firefox to complete the installation of add-ons and there are probably more cases.

  • The latest version of iTunes com addin for outlook cause outlook to hang when exiting

    iTunes Version 11.0.0.163 com addin for Outlook causes Outlook 2003 used on a Windows XP machine to not close when exiting.  I have verified via the Task Manager that it Outlook does not close.  I have gone into Outlook and disabled the addin and Outlook closes properly.  Enable it again and Outlook once again does not close.  This did not start hapening until I upgraded to the latest version of iTunes.  I have both an iPhone and iPad that I need to keep synced with my Outlook calendars, contacts and notes.
    How do I get in touch with someone at Apple to report this.  I have been all over their website, but cannot seem to find any email or phone number to report software bugs.

    Hey Gambitv,
    Thanks for the question. I understand you are experiencing issues downloading and installing iTunes. The following resource may help to resolve your issue:
    Trouble installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    Thanks,
    Matt M.

  • I can't re-enable the save and quit option when i close a window

    When you close a window, there appears a window containing the options: Save and close, close without saving and cancel, and a box that says do not ask again. Well, a friend checked this last option by accident and now every time I close when I open again I see the same pages where I was before closing. My question is: Is there any way to re-enable the option to exit without saving?

    In the [[Location bar autocomplete|Location bar]], type '''about:config''' and press Enter . The about:config "This might void your warranty!" warning page may appear. Click I'll be careful, I promise! , to continue to the about:config page.
    Search for the preference '''browser.tabs.warnOnClose''', and double-click on it which should set the value to '''true'''

  • Program Crash When Exiting Editor

    I am running Photoshop Elements 8.0 on a Gateway PC with Windows 7 Premium Home version. I installed both Photoshop and Premiere Elements without errors. Whenever I used the editor in photoshop I get an error when exiting ther program. I get a message saying the program stopped unexpectedly and get the following:
    PhotoshopElementsEditor.exe - No Disk
    There is no disk in the disk drive. Please insert a disk into \Device\Harddsk1\DR1
    I have to click cancel several times until the message goes away.
    Any ideas?

  • 30EA2: Data Modeler Viewer annoyance when exiting

    Hi,
    Almost always when exiting sqldev, I'm prompted with a dialog stating the 'Data Modeler Viewer is waiting for tasks that should finish, such as writing files', being able to Wait or Exit now. In the Log, I get an entry 'Delete Design: "Untitled_1"'.
    Please make sure to clean up correctly before prompting such a dialog.
    Thanks,
    K.

    Hi,
    I can confirm this is happening on me too.
    I am confused, since I didn't invoke Data Modeler Viewer, yet the prompt appears just before prompting to Save the modified Worksheet.
    This probably a minor bug, but hopefully to be addressed, since it is quite confusing.
    Regards,
    Buntoro

Maybe you are looking for

  • Finding changes in SAP tables

    Hi, I have problem with SAP - Cognos interface. It functions like an ABAP program that generates a file from spec. fields of some SAP tables like BKPF, BSEG, BSID, BSIK, etc. And this is all OK, but problem is that report always selects ALL data, and

  • Logical system for new client

    Hello experts, I want to copy all users and assigned roles from Quality to the production system. But as a safety measure I want to copy the existing users and role assignment from production system too one of the test system. For this I created a ne

  • POWER ADAPTER HAS JUST CAUGHT FIRE!!!

    While sitting using my 15' powerbook g4 i noticed a strange burning smell. At closing the screen i realized what it was, the power adapter had caught fire at the part where the cable enters the brick. This could have been disastrous if i wasn't here

  • Org structure table

    Hi,    can anyone send me the tables where the attributes of the organization unit is stored. my requirement is that i need to upload the attribute (WBS element in mycase) for the organization units from an excel sheet to the relevant tables so that

  • Determining Logical Hostname

    We have a (non-cluster-aware) client-server application that has several background client programs that do asynchronous processing. In principle, these can be distributed among an arbitrary number of hosts, although in practice usually all reside on