What Listener to Choose ?

Hello,
My situation is as follows:
I have implemented two InputVerifiers, which tracks whether a valid(not negative, integer, not empty...) number was entered into several text fields.
Whenever there is an invalid value a warning message displays. That is correct.
My problem is:
Concerning the situation described above. If there are not valid values in my text fields and I want to close the window ("Close" button).
However instead of closing the window, a warning message displays, that the "text field value is invalid". This is not correct. I want to close the window, no matter what values are in the text fields.
My idea:
I thought it would be possible to add some listener to the "Close" button, which would set the inputVerifiers of the text fields to null and then, at some other point in the code I would set it back.
I tried ChangeListener(), however this approach worked pretty strangely for me (Closing the window was OK, but then the warning messages stopped to be displayed at some moment).
Anybody has any advice for this??
Thank you very much and wish you a luxurious day:)
Adam

Hi Adam,
You don't need another listener, you could just check if the window should be closed and then call Frame.dispose().
The InputVerifier method that does the validity check could look like this:
public void checkInput(/* some parameters*/){
   String input = textField.getText();
   boolean invalidInput = true;
   /*Input validation*/
   if (invalidInput){
       if (closeWindowCondition){
             window.dispose();
             return;
       //the window should remain open, just display an error message
       JOptionPane.showMessageDialog(window, "error message", "title");
}If I understood you correctly that should do it.

Similar Messages

  • In Acrobat pro 9, I can't find staple and fold options for booklets and no matter what options I choose in the print dialogue my booklet ends up with pages upside down and out of order?

    In Acrobat pro 9, I can't find staple and fold options for booklets and no matter what options I choose in the print dialogue my booklet ends up with pages upside down and out of order? I am working on a Macbook pro running OS X 10.9.4.  Our printers are fully capable for booklets with staples and folds. Would love some help. Thank you!

    To: ~graffiti
    (This email is not intended to go on public forum -- but I wanted to respond
    to you)
    Thanks for your reply....FYI...I was trying to download from www.adobe.com on
    the specific page that has downloads of your products.    As far as the
    alternate source is concerned I am not totally sure what the capabilities it has as
    I am recovering from a hospital stay and had to send my wife to retailer to
    pick this up because I am accessing email from home until I return to work and
    need something to work now.  I don't yet have the SW.  (I would have had her
    buy the actual Adobe Pro 9.0 -- but it is a wapping $499 and change).
    Regards,
    Staurt Rednor ("Stu") - [email protected]
    ===========================================================
    Subj:   New message: "No matter what I try can't download
    Adobe Pro 9.0 or free Adobe Reader"   
    Date:   4/5/2009 7:38:17 PM Eastern Daylight Time  
    From:   [email protected]   
    Reply-to:   [email protected] 
    To: [email protected]  
    Sent from the Internet (Details)   
    SGuitar43,
    A new message was posted in the thread "No matter what I try can't download
    Adobe Pro 9.0 or free Adobe Reader":
    http://forums.adobe.com/message/1867664#1867664
    Author  : ~graffiti
    Profile : http://forums.adobe.com/people/~graffiti
    Message:

  • What drivers to choose

    Hello.
    I had a HDD crash and I reinstalled Windows XP Pro
    IBM ThinkPad T40 2374-BG9.
    Did I download the drivers of the Lenovo site, but I don't have a Wireless access, nor audio!?
    Wireless: what driver to choose:
    Intel Pro / Wireless LAN 2100 3 B Mini PCI Adapter XP T40 = 1rwc89ww.exe (or / and)
    Wireless LAN Software ThinkPad 802.11ab,... XP T40 = 77wc39ww.exe
    Intel Wireless LAN (11abgn, abg, bg) XP ThinkPad = 7kwc50ww.exe
    Cisco system Mini PCI WiFi LAN Driver = 1kwc42ww.exe
    ThinkVantage sys XP update = systemupdate316-2013-4-15.exe
    ThinkVantage access XP connection = ggcx01ww.exe
    (message ACTray.exe error: Untraceable MFC71U.DLL??
    Audio:
    Audio driver heart XP T40 = 1ga241ww.exe = C:\Drivers\Win\Audio = SoundMax = not of sound = not of driver high talker system controller interfaces LPC Intel 82801DBM-24C
    Thank you for your collaboration
    Solved!
    Go to Solution.

    Decoppet wrote:
    Hello.
    I had a HDD crash and I reinstalled Windows XP Pro
    IBM ThinkPad T40 2374-BG9.
    Did I download the drivers of the Lenovo site, but I don't have a Wireless access, nor audio!?
    Wireless: what driver to choose:
    Intel Pro / Wireless LAN 2100 3 B Mini PCI Adapter XP T40 = 1rwc89ww.exe (or / and)
    Wireless LAN Software ThinkPad 802.11ab,... XP T40 = 77wc39ww.exe
    Intel Wireless LAN (11abgn, abg, bg) XP ThinkPad = 7kwc50ww.exe
    Cisco system Mini PCI WiFi LAN Driver = 1kwc42ww.exe
    ThinkVantage sys XP update = systemupdate316-2013-4-15.exe
    ThinkVantage access XP connection = ggcx01ww.exe
    (message ACTray.exe error: Untraceable MFC71U.DLL??
    Audio:
    Audio driver heart XP T40 = 1ga241ww.exe = C:\Drivers\Win\Audio = SoundMax = not of sound = not of driver high talker system controller interfaces LPC Intel 82801DBM-24C
    Thank you for your collaboration
    Hi,
    these are the original specs. your T40 left the factory with:
    ThinkPad T40 (2374-BG9)             
    Based on 2374-8CU: P M 1.5GHz, 512MB RAM, 40GB 5400rpm HDD, 14.1 XGA(1024x768) TFT LCD, 32MB ATI Radeon 7500, 24x-8x DVD(slim), Modem(CDC), Ethernet(LOM), Wireless upgradeable, Secure Chip(TCPA), UltraNav, 6 cell battery, WinXP Pro
    "Wireless upgradeable" usually means that your T40 did not leave the factory with a wireless card installed. However, I.B.M. used this marketing term to indicate the model has the wireless antennae installed in the lid of the LCD assembly and can easily have a mini-PCI wireless card added. I have opened up dozens of T40's (including, I believe, some listed as "wireless upgradeable") and I have never found one which did not have an internal wireless card installed. It seems most of these units were upgraded with a wireless card at some point in their history. I also have a theory that many of these "wireless upgradeable" units were purchased in bulk and had mass installations of wireless cards by a secondary party/ technicians before being sold on the final retail market. That's just a theory of mine.
    The T40's came with the following three wireless 'B' cards:
    ThinkPad Dual-Band 11a/b Wi-Fi Wireless Mini PCI Adapter
    Cisco Aironet Wireless 802.11b
    Intel PRO/Wireless LAN 2100 3B Mini PCI adapter
    These are the official names designated in System service parts - ThinkPad T40, T40p, T41, T41p, T42, T42p. These were all wireless 'B' adapters, but T40 can easily be upgraded to some of the wireless 'G' cards you see listed for the T42.
    There is only one way to know for sure which (if any) wireless card your T40 has. You will have to remove the keyboard and take a look under the hood. Follow the steps in the Hardware Maintenance Manual - ThinkPad T40, T40p, T41, T41p, T42, T42p. Then we can help you locate the appropriate drivers.
    Here are some movies with step-by-step instructions which can help you and others who may be reading:
    Hardware Removal & Installation Movie Index - Notebooks
    Hardware removal and installation - ThinkPad T40/p, T41/p, T42/p, T43/p
    Keyboard removal movie - ThinkPad T40/p, T41/p, T42/p, T43/p
    Keyboard installation movie - ThinkPad T40/p, T41/p, T42/p, T43/p
    Palm rest removal movie - ThinkPad T40/p, T41/p, T42/p, T43/p
    Palm rest installation movie - ThinkPad T40/p, T41/p, T42/p, T43/p
    Mini PCI removal movie - ThinkPad T40/p, T41/p, T42/p, T43/p
    Mini PCI installation movie - ThinkPad T40/p, T41/p, T42/p, T43/p
    As for audio, make sure you are first updated to Service Pack 3. Allow Windows to do other preliminary updates and it should then inform you that Service Pack 3 is ready for download. After installing SP3, you will be able to install audio drivers successfully. See my post here for a few additional hints: http://forums.lenovo.com/t5/T61-and-prior-T-series-ThinkPad/T60-no-sound-after-reinstalling-XP-sp2/m...
    If Windows updates is taking forever to give you the option to install SP3, here is an official Microsoft link where you can directly download SP3. (Many people don't know about this link :http://www.microsoft.com/en-us/download/details.aspx?id=24). Just keep in mind, however, that you should have a stable XP SP2 setup before installing SP3 as it makes many registry changes and configurations and can lead to blue screens or cause your system to hang upon reboot if not installed properly. (I am speaking from experience LOL ). Also, make sure you have a stable hard drive before installing SP3 as it gives your hard drive a major workout. If your hard drive is corrupted or has just a few KB of bad sectors, this can lead to your system hanging when you try to restart after installation. SP3 will write important data to bad sections of the hard drive, then fail to re-start successfully and it will be a big headache. Therefore, you should run Chkdsk several times to attempt to close off any bad drive sectors before attempting to install SP3. SP2 is quite merciful and installs in a breeze, but SP3 can be treacherous. I mention this because you told us above that your hard drive has previously crashed.  
    Have a great day. (I do not work for Lenovo)

  • What direction to choose after getting ocp

    Hello, guys
    I am thinking about next step in my education. What course to choose among Oracle products?
    I have OCP 11g already and had course in performance tuning.
    Can someone give me advice what Oracle product to learn next? I must say that our organization's budget is limited, so I can choose any of 1 week Oracle courses.
    I consider Oracle RAC (however, its not used widely in our country), WebLogic, Application server or SOA Suite.
    The main criterias are a product's popularity and it should have perspective for the next several years
    Any help would be appreciated.

    Thanks
    Hemant K Chitale написал(а):
    You are lucky that your organization is paying for courses !
    If you want to continue being a database administrator, RAC would be the direction (the 11gR2 Accelerated Grid and RAC course is the most expensive course I've seen).  However, if you are also supporting other products -- e.g. WebLogic is popular -- you'd do a course in that product.  If you perceive being an EBusiness Suite administrator, you'd consider a course in EBusiness Suite or Fusion Applications administration.
    Hemant K Chitale
    Thanks. I will study RAC 11g next week.

  • Same filesize no matter what bitrate I choose

    Hello everyone.
    So, I just noticed this problem. It doesn't really matter what bitrate I choose (Only matters if I go below 70) I get almost the EXACT same file size and quilty.
    Here are my export settings.
    I have a YouTube channel and I upload videos everyday so I want them to be in the best quality possible. This has always worked for until recently. If I export the same video with a bitrate of 300 and then again with a bitrate of 200, the filesize difference is usually about 1MB.
    This is starting to annoy me a lot because if I check the videos bitrate after I've exported it, it is NOWHERE NEAR 300. For some reason it chooses to render at a bitrate of 76-80 no matter what.
    Here is a picture of my timeline:
    I'm using Adobe Premiere Pro CC on a Windows 7 PC.
    PC SPECS:
    GPU: GIGABYTE GTX 670 4GB
    CPU: Intel i7-3770k @3.5Ghz (Overlocked to 4.1Ghz)
    RAM: 16GB
    MB: GIGABYTE GA-Z77P-D3
    If there is anything else I need to tell you that I might've missed, please tell me so!
    I really need to get this fixed as my videos look nowhere near as good as they used to now.

    Also, please stop telling me that the bitrate is too high or something, that's not the problem.
    I get that. As I said, you have hit a wall of some kind. I am not sure that anyone ever tested about 70Mb/s. Maybe that is the wall that can't be climbed over.
    Submit a bug report. Perhaps it will be an easy fix. Perhaps they already know about it and are just waiting for enough people to complain that it becomes worth spending engineering resources on it.
    If you want to export at that high a rate, and the software seems to let you try it, the the software should actually do it. I agree.
    Although at that bitrate you might as well export to a lossless codec. What is the point of a lossy codec at a bit rate higher than the original recording? It can't be quality because you can't get higher than 70 right now, so my guess is that you have never seen a quality improvement at 300. You can't get to 300. Not really.

  • No matter what tool I choose, all I get is a hand cursor

    I recently installed Photoshop CS4 and didn't have any problems with the installation.  However, quite frequently the program gets into a mode where no matter what tool I choose all I get is a hand cursor.  I've tried logging off to correct the problem, but that doesn't work.  Rebooting the computer is normally sufficient.  I haven't determined any specific actions that always cause this circumstance to arise.  Does anyone have any ideas on what my problme might be?
    BTW, I'm running on Windows XP Pro, 32-bit, with 3.5 GB of memory and a 2GHz dual-core cpu.
    Thanks.

    This is my expereince as well.  I've never seen the problem in any other application and I've been using Photoshop for over 15 years, and this is the first version that I've encountered this problem.  And like you, when I switch to any other program the mouse and keyboard work just fine, so it is not a physical keyboard problem.
    But, if hitting the space bar a few times solves the problem, then I'm happy for now.
    Thanks all.
    Chuck

  • I'm trying to load the free trial of Illustrator; I get to the Download page, click the big blue box at the top righthand of the screen, but it asks me to choose an application (?)  What should I choose to open my new trial with?  Thanks.

    Giving Illustrator a try with the free trial offer.  When I go to download Ai, I am asked to choose an application with which to open it--what should I choose?

    Sounds like you maybe trying to download with firefox. In Internet explorer it will automatically switch to the correct application, but with firefox it prompts you instead.
    Scroll down the window and find content manager. That will download the installer. Run the installer, after the installer has finished and the manager runs. Open the manager if it is not already, then from there you can select illustrator. It will install it for you.

  • My PSE12 will only type CAPITAL letters no matter what font I choose.  Started doing this yesterday

    My PSE12
    will only type CAPITAL letter no matter what font I choose.  Started doing this yesterday and I can't get back to having upper and lower case letters.

    Perhaps you could reset the tools using this method:
    1) Launch PSE in Editor Mode
    2) click on the Expert Tab
    3) At the bottom right corner look for something like this :
    This should solve the problem quickly.
    Good luck and post back.

  • What sequence to choose?

    I am not a newbie to video editing, but I am no pro either! I have taken on a pretty big task of making a family documentry. I have every video and picture from my family's past, and video I just recently shot. The orginal video was recorded on 8MM tape, vhs, HI8, SD, HD60i, iPhone, iPad2. The iPhone and iPad I used an app called Filmic Pro, which was recorded in 30p). I already have everything converted professionally to a digital format on a hard drive. I don't really know what to do here. I don't know what sequence to choose, or if I should work in progressive or interlaced.
    Any suggestions?

    Thank you for your advise shooternz. I went through all of my footage and made a list of the codecs and pixel x pixel dimensions. The profesionally digitised media are .mov, and the sizes range from 600mb to 10GB.
    How do I scale down the footage?
    .mov 640 x 480      29.97 fps (transferred from 8mm film)
    .mov 720x480        29.97 (transferred from 8mm film)
    .mov 720 x 480      29.97 fps (transferred from VHS)
    DV 720 x 480         29.97 fps (transferred from Hi8/captured firewire to iMovie)
    MPG 720 x 480      29.92 fps (recorded on a 60i consumer camera)
    MTS 1440 x 1080  29.97 fps (recorded in 60i consumer camera)
    .mov 1280 x 720    30 fps (recorded on iPad2/ used app called Filmic Pro  32mbit/sec)
    .mov 1280 x 720    30 fps (recorded on iPhone 5/used app called Filmic Pro 32mbit/sec)
    .mov 1920 x 1080  30 fps (recorded on iPhone 5/used app called Filmic Pro 32mbit/sec)
    .mov 1920 x 1080  30 fps (recorded on Zoom Q2)
    Also when I play any of the footage recorded from the iPad and iPhone in the source window it doesn't play back smooth. No jittery, but kind of warbley.
    Thanks

  • What listener to use

    what listener do i use when i want have something to happen when i clicked on a jlist other then mouse listener?

    ActionListener

  • Hi, i want to buy a licence of Creative Cloud, but i have one question... Whats the best choose for a little enterprise?? And if i buy a Single Person Licence, on how many pc's can i install the suite??

    Hi, i want to buy a licence of Creative Cloud, but i have one question... Whats the best choose for a little enterprise?? And if i buy a Single Person Licence, on how many pc's can i install the suite??
    Thanks for helping

    no, that's incorrect.
    you can activate on 1 mac and 1 pc, or 2 pc's, or 2 mac's, concurrently.
    i have cc installed on 2 pcs and 1 mac.  i can only activate 2 at any one time which works well for me because my pcs are at home and my office and i use them most of the time.
    but when i travel i take my macbook so i just deactivate one or both of my pcs (uninstalling is not needed) and sign in to my macs cc app.

  • Hello . I'd like to buy an iPhone 5S Space Gray 64GB and get free shipping from the USA to Russa but the problem is I don't know about wireless service plan . What should I choose for Russian wirelesses ? Does T-Mobile work in Russia ? Please , help me

    Hello . I'd like to buy an iPhone 5S Space Gray 64GB and get free shipping from the USA to Russa but the problem is I don't know about wireless service plan . What should I choose for Russian wirelesses ? Does T-Mobile work in Russia ? Please , help me
    Sorry , but product is iPhone 5S

    You can't buy from the Apple store online in the US because it is country specific and you firstly need a US credit card and then a US address and they won't ship outside of the US so you can't.
    No Apple online store will ship outside the coutry.
    If you want an iPhone, then you'll have to order via the Russian Apple store online if there is one, or you'll have to wait until it is released in your own country or go and buy one in Europe.

  • What listener do you use for adding text to JTextField?

    what listener do you use for adding text to JTextField?
    I have a component which adds some text to my JTextField, and I want to pick up this event. I have tried ActionListener with no effect.
    cheers,
    Olly

    jtextField.getDocument().addDocumentListener();
    The DocumentListener implements:
    changeUpdate() insertUpdate() removeUpdate().
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/event/DocumentListener.html

  • What do you choose 16:9 or 4:3

    Between the two choices, 16:9 widescreen and 4:3 regular, which aspect ratio do you choose when creating a movie in imovie and why?
    I would appreciate feedback as it will help determine what I will do for a dvd I am making for someone else. I do not know what kind of tv they have or if they will be viewing it on a computer.
    Thank you!
    SJB

    16:9
    have a 'widescreen' tube for >10 years. widescreen is 'natural' viewing, most 'action' is acting horizontal, most landscapes are horizontal orientated ...
    any DVDplayer allows to add black-bars for playback of 16:9 on 4:3 displays (=letterboxing) ..
    so, I don't care, what kind of display is in use for delivery.

  • What should I choose? Canon SX280 HS vs. G1x

    I have to choose between these two models. G1x with a better senzor and more MP, and SX280 HS with the new processor, 20x zoom and GPS.
    I need the camera for video purpose, shooting video at 1080p, and sometimes also in low light conditions.
    Which one has better video quality? Which one should I buy?
    Thank you! 

    The G1-X has a CONSIDERABLY larger sensor and better ISO performance... but the zoom range is more limited.  Also... part of what you pay the premium for in a G1 X is that it has a particularly large lens and sensor.  It's image quality is much better than what you'd expect from a point & shoot -- but keep in mind that the zoom range is limited and you cannot change the lens... so it is what it is.  
    Have you considered the EOS-M?  In a fairly small-ish body that camera basically has the SAME sensor that you find in nearly every Canon DSLR body -- it's the same sensor they use on the T2i, T3i, T4i, T5i, 60D, and 7D bodies... but in a much more compact camera.  The lens is removeable and you can get an adapter that allows you to use regular EOS DSLR lenses.  
    The EOS-M actually does have a microphone-in port so you could connect a much higher quality mic -- i.e. one of the Rode VideoMic series mics which are awesome.  It also has the hybrid sensor AF system similar to the 70D but I don't know if it's as good as the 70D's hybrid sensor AF (which I hear is fantastic.)
    The new 70D is probably *the* camera to have, but that'll be in a whole new price range.  The 70D is not yet shipping (dealers are taking pre-orders.)
    I have a G1 X and can vouch for the fact that it's built like a tank -- although I really never shoot video with my cameras..  One of my "other" hobbies is astronomy.  My better-half was using a G1 X with an adapter that allows us to connect it to a telescope and accidentally "dropped" the camera while he was trying to disconnect it from the telescope.  It fell about 3' onto a concrete sidewalk.  Immedaitely thoughts are running through my mind... is it totally trashed or will it be salvageable if we send it in for service?   
    Tunrs out... there's a _very_ tiny dent in the corner of the camera body (the G1 X has a metal body) where the camera hit the sidewalk and absolutely nothing else on the camera shows the slightest hint of damage.  Camera works flawlessly.  The dent is so small that unless I really draw your attention to it, you probably wouldn't even notice it.  I must say I was REALLY impressed.  I should post a photo of it -- but lets just say this completely changed my perspective on how solid this camera is.  I normally think of them as delicate... I don't think that anymore.
    The G1 X basically has a cut-down version of the 18MP sensor that you find on Canon Rebel EOS-M, T2i, T3i, T4i, T5i, 60D, and 7D bodies... but they've cropped it down to about 80% of the APS-C size.  It's about as close as you can get to DSLR performance in a point and shoot camera.  The EOS-M has a full APS-C size sensor and removeable lenses.
    If you want to try the G1 X, I noticed LensRentals.com will rent you one ($39 for 4 day rental).  You could try it before you decide if it'll work for you.  
    But if you REALLY plan to shoot primarily video, then consider an actual video camera or a camera more optimized for video such as a 70D.
    Tim Campbell
    5D II, 5D III, 60Da

Maybe you are looking for