Document Listener not working the way i would like

Hello.
I have this situation:
A Jtable and a field of JTextfields that are populated by clicking on the JTable rows or manual inserction.
All the JTextFields have a DocumentListener attached.
When i click on a row, every JTextField that is populated fires a insertUpdate and a removeUpdate event(the 1st click fires only insertUpdate).
What i want is to catch this events only when someone chances anything on a JTextField.
Ex: I click on row5, it populates the info and i change the address field, if i lose the focus or if i click on other row, i need to present a popup saying "Save or Discard changes".
Any ideas how i could implement this?

When you click on a row in the table your code should
be something like:
textField.removeDocumentListener(...);
textField.setText(...);
textField.addDocumentListener(...);Now when a DocumentEvent is generated you know it is
because the user changed the text, not just because a
new row was selected.Is there a way to get the Listener associated, i tryed
textfield.getDocument().removeDocumentListener(new MyDocumentListener())but the component didn't lost the listener.
Message was edited by:
noe.rocha

Similar Messages

  • Making Links from UL Not Working the way I would Like

    Hi,
    Just trying to learn more of CSS and am having a problem.
    I make a vertical unordered list and used the li tag to make a "box" arond each link (red text/black background/red border)
    I then made the text in each box a link using the menu "Modify/make link" option. This works fine.
    So next I tried to create a compound rule (li,a:hover) to change the font color to black and the background color to red - basically reversing the colors from the non-hover state. So on hover , while the text changes to black as I want it to the background just changes to red as soon as I select that color in the rule?
    Here are some pics to show what I am trying to explain.
             NON - HOVER
                   li,a:hover tag
    I'm guessing I am not using the li,a:hover tag properly and am sure someone can set me right.
    Also, using the "Modify/Make link menu option will only make the text a link but I would like the whole box area of eah item to be a part of the link - how would you do that? Do I have to make each item an image?
    And heres the CSS.
    @charset "utf-8";
    body {
    background: url(../_images/Background.jpg);
    body, html {
    margin: 0px;
    padding: 0px;
    text-align: center;
    p {
    font-family: "Times New Roman", Times, serif;
    font-size: 18px;
    color: #FFF;
    text-decoration: none;
    h1 {
    font-family: "Times New Roman", Times, serif;
    font-size: 24px;
    color: #FFF;
    margin-top: 0;
    text-decoration: none;
    #wrapper {
    text-align: left;
    width: 1000px;
    position: relative;
    margin-right: auto;
    margin-left: auto;
    #header {
    height: 200px;
    width: 1000px;
    clear: both;
    #header img {
    margin: 0px;
    padding: 0px;
    height: 200px;
    width: 1000px;
    #mainContent {
    height: 900px;
    width: 765px;
    float: right;
    margin-bottom: 45px;
    padding-right: 25px;
    padding-left: 10px;
    #sideBar {
    height: 900px;
    width: 200px;
    float: left;
    clear: left;
    #footer {
    background-color: #060;
    height: 200px;
    width: 1000px;
    clear: both;
    ul {
    padding-left: 5px;
    margin: 5px 0px 0px;
    li {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: medium;
    line-height: 1.5em;
    font-weight: bold;
    text-transform: uppercase;
    color: #F00;
    width: 125px;
    border: medium inset #F00;
    list-style: none;
    margin-top: 5px;
    margin-bottom: 5px;
    background: #000;
    padding-left: 10px;
    li, a {
    color: #F00;
    text-decoration: none;
    li, a:hover {
    color: #000;
    background: #F00;
    Thanks

    li, a = apply CSS rule to any <li> tag and (separately) to any <a> tag
    li, a {
    color: #F00;
    text-decoration: none;
    is the same as writing:
    li {
    color: #F00;
    text-decoration: none;
    a {
    color: #F00;
    text-decoration: none;
    li a = apply CSS rule to any <a> tag found inside a <li> tag
    The second one (space between the li and a) is what you want here.

  • Hi, i would like my membership cancelled. I got it yesterday but its not working the way i wanted it to work. How do i go about that i getting my refund as its before 30 days.

    Hi, i would like my membership cancelled. I got it yesterday but its not working the way i wanted it to work. How do i go about that i getting my refund as its before 30 days.

    Hi kondwastefstef,
    I'm sorry that your subscription didn't meet your needs. Please contact Adobe Customer Support via phone or chat; they should be able to cancel your account and process your refund. Here's the contact information: Contact Customer Care
    Best,
    Sara

  • My phone is not working the way it did before the manditory iOS 7 update.

    My phone is not working the way it did before the manditory iOS 7 update.  It freezes, it lags, I get kicked out of my apps, my messages do not send half of the time, I can't view the pictures in my camera roll if I enlarge them, and the phone glitches randomly.  How can this be fixed or what do I need to do to get it replaced??

    The Basic Troubleshooting Steps are:
    Restart... Reset... Restore from Backup...  Restore as New...
    Restart / Reset   >  http://support.apple.com/kb/ht1430
    Restoring  >  http://support.apple.com/kb/HT1414
    If you try all these steps and you still have issues... Then a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is the Next Step...
    Be sure to make an appointment first...

  • I need to cancel my membership I got today it did not work the way I wanted to and my computer is not working with it. Thank please cancel to today!!

    I need to cancel my membership I got today, it did not work the way I wanted to. So please cancel it today! Thanks

    This is a user forum; we have no access to your subscriptions, but we can help you to get it canceled.  So what did you subscribe to:
    Creative Cloud?
    an Acrobat.com online service?

  • Ps 3d and filters and save for web are not working the way they should

    At work we just put cs6 on a w7 machine running 64 bit which has more than that required mem and or ram to run cs6 - unfortunately I have to use a windows based machine at work (cheapskates). Anyways. I see the 3d menus and the filter menu in PS but they aren't funtional. The filter menu drop down is there but Liquify is the only one that shows up the rest are gray. The option to choose 3d is also there but they are not functional (grayed out) - I took a look at some online tutorials on using the 3d effect in PS CS6 and Ive gone through it a few times and it still won't work for me. Also, in illustrator when I save for web - when I adjust the pixel dimensions and move the mouse over and click on the image that I am saving for web nothing happens and I'm completely boggled about how to get the image size to change in the save for web pane. Typically I am used to being able to input the the number into the pixel dimenion field and click on the image and the image resizes (on a mac you can either click on the image or hit return and the image will resize in front of your eyes!). I am unable to get this to work the way I am used to, this happens for me in both ill5 and ill6 on this piece of crap windows machine. Maybe I just need to reinstall? Maybe adobe has changed the way this works? Maybe a sledge hammer into this windows machine would solve all my problems!? IDK. someone help... help me... pleeeeaaaaaaaaaaasssseeeee

    unfortunately I have to use a windows based machine at work (cheapskates).
    This gets a "stupid comment of the day" medal. Seriously. These days Macs are just as convoluted and effed up as Windows was a few years ago - nice as long as everything works, but god forbid you have a problem. So by all means, update your graphics driver and be glad that you actually have that choice rather than having to wait half a year for Apple to fix it...
    Mylenium

  • Range partitioning does not work the way I thought it would

    I have a table that is range partitioned by number.
    The number represents a date field of the form: YYYYMMDDHH24
    However, there are extra values on the end of the field that represent an exact datestamp so a record looks like
    20071102100000001
    What I found in my tests is that if I have a partition based on range based on the following:
    values less than (2007110210)
    Any records inserted with a length greater than what is above automatically go to the future partition. It does not make sense that I would have to add another column and then do a substr on this field for just the first 10 characters to get them to go to the correct partition.
    ???? I am at a bit of a loss.

    Hi
    If you a column storing a timestamp you should use the timestamp or date datatype, not something else!!! Not only it makes not sense but you will have a lot of problems with that. To name only two: not consistent data and misleading the query optimizer.
    As you defined, since 20071102100000001 is greater than 2007110210 (i.e. not less then), I don't see why do you expect something else.
    HTH
    Chris

  • Copy Cell not working the way it did in Numbers '08

    It seems that Numbers '09 changes the way things get copied and its ruining my work process. I've got a spreadsheet with video timecode and transcriptions in it that I'm doing a rough paper edit in and then copying the timecode into Final Cut Pro.
    In Numbers '08 if you select a cell and copy, the text inside gets copied as formatted text. So when pasting into Final Cut, I'd get this:
    00:00:07:20
    But in Numbers '09, I get this:
    Unnamed Table
    00:00:07:20
    And if I paste it into TextEdit, it pastes the cell as a cell of a table with the name Unnamed Table above it.
    That being said, when I just tried to write this post up, I pasted the cell into this form box and it looked like this:
    00:00:07:20
    So, it would seem that if you are pasting into a plain text area it pastes the basic text, but if you're pasting into a rich text formatted box, it will try to paste a Table.
    I guess my problem is that the Timecode boxes in Final Cut are reading rich text when they really shouldnt be.

    One more time,
    use the script:
    Save this script as an application bundle named clipboard2text.app in:
    <starupVolume>:Users:<yourAccount>:Library:Scripts:Applications:
    Maybe you will have to create the Applications subfolder.
    Seach for the keaword Script in the Finder's Help to learn the way to activate the Menu Scripts in the menu bar.
    When you will have to paste in Final Cut Pro (or other programs)
    From Numbers copy the datas
    menu Scripts > clipboard2text
    Then paste where you want.
    set the clipboard to (the clipboard as text)
    Yvan KOENIG (from FRANCE mardi 27 janvier 2009 16:36:31)

  • JCreator not working the way i want it.

    sorry for the catchy subject header...and my pre thanks for solution providers..
    PROBLEM I AM FACING:
    I am using JCreator pro and its intellisense is not working...I had previously installed JavaFX and then removed it...is it the side effect I am having ?
    MY NEXT PROBLEM:
    also i have copied java API docs to same folder as JDK ..now when i highlight the code and press F1 i don't get API doc for the highlighted keyword...instead a bookview is shown at the right corner.....what could be the problem...please explain the solution in a beginners tone..I am new to java...thank you very much once again..... :D

    Is this what you are looking for?
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <style>
    body {
        width: 940px;
        margin: auto;
    html {
        background: url(http://www.pwaworldtour.com/fileadmin/user/main_editors/images/hi_res/ARUBA_2011/A11_fs_WOMEN/A11_fs_ARU91_1755.jpg) no-repeat center center;
    .content {
        background: white;
        padding: 20px;
    </style>
    </head>
    <body>
    <div class="content">
        <h1>Header</h1>
        <p>Whose worth's unknown, although his height be taken. Let me not to the marriage of true minds admit impediments; love is not love love's not time's fool, though rosy lips and cheeks. Oh, no, it is an ever fixed mark which alters when it alteration finds, it is the star to every wand'ring bark. Let me not to the marriage of true minds admit impediments; love is not love within his bending sickle's compass come.</p>
        <p>Love's not time's fool, though rosy lips and cheeks if this be error and upon me proved, oh, no, it is an ever fixed mark. Or bends with the remover to remove. Admit impediments; love is not love whose worth's unknown, although his height be taken.</p>
        <p>Within his bending sickle's compass come; which alters when it alteration finds, but bears it out even to the edge of doom. That looks on tempests and is never shaken; love's not time's fool, though rosy lips and cheeks I never writ, nor no man ever loved. If this be error and upon me proved, within his bending sickle's compass come; it is the star to every wand'ring bark.</p>
    </div>
    </body>
    </html>

  • Lightbox not working the way it's supposed to

    I can't get lightbox to show the way it's intended -- images keep popping up on the screen but not in the "lightbox" style.  There's no "popup" and no greyed out background.  I copied and pasted the code for reference.
    I have a folder with all the lighbox parts in it -- css, js and images.  I first had my images in a separate folder, but that didn't work.  I moved the images into the "lightbox images" folder and that didn't work either.
    By the way, I'm fairly new at this so if you see something that's wrong or needs to be adjusted, go easy on me! 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Taylor LightBox Test</title>
    <script type="text/javascript" src="js/prototype.js"></script>
    <script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
    <script type="text/javascript" src="js/lightbox.js"></script>
    <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
    </head>
    <body>
    <p><a href="lightbox2/images/Bay Large Image.JPG" rel="lightbox"><img src="lightbox2/images/Bay Small Image.jpg" alt="Lakewood Bay" width="400" height="300" border="0" /></a>
    <p><a href="lightbox2/images/Dad's Large.JPG" rel="lightbox"><img src="lightbox2/images/Dad's Small.jpg" alt="Dad's House View" width="400" height="300" border="0" /></a>
    <p><a href="lightbox2/images/LO from WL.JPG" rel="lightbox"><img src="lightbox2/images/LO from WL SMALL.jpg" alt="from WL" width="400" height="300" border="0" /></a>
    </body>
    </html>

    Hello,
    Lightbox should be relatively easy to get up and running so, don't worry too much there's bound to be an answer.
    You mention that you changed the location of images, sapping them from one folder to another but where the images are isn't as important as making sure that your page links to them accurately.
    So take this line first of all:
    <p><a href="lightbox2/images/Bay Large Image.JPG"  rel="lightbox"><img src="lightbox2/images/Bay Small Image.jpg"  alt="Lakewood Bay" width="400" height="300" border="0" /></a>
    First thing is to say, there should be a closing </p> tag after each use of the <p> element.
    Then, you have a folder lightbox2 with a sub folder images with an image Bay Large Image.JPG in it.  (It's not such a good idea to have spaces in any file name on the web by the way so if you can, change that to BayLargeImage.jpg or Bay-Large-Image.jpg).  But is your file structure like that?
    The next thing is to point out that each of the script links in the head need to point to the appropriate files too.  So, this line for instance: <script type="text/javascript" src="js/prototype.js"></script> indicates that you must have the file prototype.js in a folder called js.  Is that how it is?
    Having said all that,not closing that <p> element might not be helping at all!
    Martin

  • GTX 970 not working the way it should.

    Hello, I bought a msi gtx 970 yesterday but it is not working good. I can not even play league of legends without stuttering. When I play on maximum settings it says 60 fps, but in fact it is stuttering. The memory clock keeps shooting up to 3506 and than goes down again, this keeps happening. When I had call of duty advanced warfare open for 10 minutes, not even being in a game, the gpu usage is 98% and the memory use is extremely high, while nothing is happening on the screen, just some menus.
    All drivers are downloaded and previous drivers from my old video card are removed.
    These are my pc specs.
    i5 760 @ 2,8 GHz
    msi gtx 970
    8gb DDR3 RAM
    Asustek V-P7H55E motherboard
    Windows 8.1 64 bit
    Hope someone can help me out.

    Quote from: Nichrome on 09-February-15, 22:57:36
    My current 780Ti is getting bottleneck by the CPU I have.. so even worse would be if I'd have 970 or 980..
    That's because yours is the T version. It's not even nearly as good as the normal 4670 or K version.
    Actually, it the lowest of the versions. Even S version would be better.
    With normal 4670 and 4670K you wouldn't be getting bottleneck.
    Quote from: lucas-1996 on 09-February-15, 22:07:05
    I have one more question. I cant really decide if I shall get the i5-4690k for my new motherboard or the i7-4790k. Is the i7 worth the 100 euro extra? I dont do things like photoshop, maybe a bit of streaming though.
    What kind of cooling you have currently, or are you using stock cooler?
    If you don't have sufficient cooler or are running stock cooler, you will need to invest on better cooling.
    In which case, get the i5 4670K and buy a new, better cooler with that 100$.
    I would recommend at least Hydro H80i if you have a free 120mm fan slot in the case.
    If not, get the BeQuiet! Dark Rock Pro 3 or similar.

  • Hello I buy apps and it's not working the way I want. So I need my full refund now

    Many times I purchase app for my iPhone it's all goin some of them it's not working  I need my full refund.

    See:
    Refunds from the App Store or iTunes - Apple Club

  • Overflow:visible; not working the way i want.

    Hi,
    ok so i have a problem with using overflow. I have an large image that I want to overflow outside the normal 940px wrapper on either side. So far it is all displayed fine however, im left with a scroll bar at the bottom of the screen which allows me to scroll over to the right untill all the image is displayed. I want it to only be visible if a large res display is being used. So how can i keep al this but remove the x axis scrol function?
    here  is my code
    <div id="cinema-wrapper">
    <div id="cinema-displays"></div>
    </div>
    #cinema-wrapper {
              width:940px;
              height:764px;
    #cinema-displays {
              background-image: url(../mackbyte_files/img/cinema-bg.png);
              height: 764px;
              width: 3109px;
              background-repeat: no-repeat;
              position: absolute;
              left:50%;
              margin-left:-1554.5px;
              overflow:visible !important;
    thanks

    Is this what you are looking for?
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <style>
    body {
        width: 940px;
        margin: auto;
    html {
        background: url(http://www.pwaworldtour.com/fileadmin/user/main_editors/images/hi_res/ARUBA_2011/A11_fs_WOMEN/A11_fs_ARU91_1755.jpg) no-repeat center center;
    .content {
        background: white;
        padding: 20px;
    </style>
    </head>
    <body>
    <div class="content">
        <h1>Header</h1>
        <p>Whose worth's unknown, although his height be taken. Let me not to the marriage of true minds admit impediments; love is not love love's not time's fool, though rosy lips and cheeks. Oh, no, it is an ever fixed mark which alters when it alteration finds, it is the star to every wand'ring bark. Let me not to the marriage of true minds admit impediments; love is not love within his bending sickle's compass come.</p>
        <p>Love's not time's fool, though rosy lips and cheeks if this be error and upon me proved, oh, no, it is an ever fixed mark. Or bends with the remover to remove. Admit impediments; love is not love whose worth's unknown, although his height be taken.</p>
        <p>Within his bending sickle's compass come; which alters when it alteration finds, but bears it out even to the edge of doom. That looks on tempests and is never shaken; love's not time's fool, though rosy lips and cheeks I never writ, nor no man ever loved. If this be error and upon me proved, within his bending sickle's compass come; it is the star to every wand'ring bark.</p>
    </div>
    </body>
    </html>

  • IChat not working the way it used to...

    Ok so I've been experiencing some stuff in iChat that I've never had happen before. Not even on my old (but lovely) PowerBook G4.
    I have a MacBook Pro 15.4" screen, 2.4 GHz, upgraded 4GB PC-5300 DDR2 RAM, 200 GB Hard Drive, with a built in Wireless N Card. I've used iChat before on my PowerBook G4 when talking to my boyfriend, and it was GREAT. We had PERFECT video feeds as well as audio. The only time it would be shaky is when someone at his house would make or recieve a phonecall (they have Vonage).
    However, since getting my new MBP, the video and audio feeds have severely decreased in quality. I mean he is always pixelated, and it's really bad if he moves quickly, the audio on his end constantly skips so instead of talking sometimes he has to type what he's saying so I can understand him and vice versa. It's also slightly delayed, more than normal anyway. It's very frustrating for both of us. We are both are running Leopard (sidenote: with my old PB I was running Panther and he had a MB that was running Tiger).
    I have Comcast internet and I own my modem. It is a Motorola SURFboard model: SB5101 and a Linksys Wireless Router WRT54G2 (I actually downgraded from an the Linksys WRT160N {MISTAKE booo!}, and I'll explain why later...)
    I had the bandwidth set to unlimited and tried limiting it to 500 after reading a few forum posts, with no change in quality. I thought it might have been my router so I exchanged that. No improvement. Tried using an ethernet cable instead of wireless, no improvement. Took my Apple back to the Best Buy where I bought it from (and coincidentally, work), no one had any suggestions. I figured then that it might be my ISP (even though I never had a problem with Comcast before using my PB), and they swear it is my computer...they also had no tech support for MAC so I didn't really take them seriously.
    Now here is where the weird part comes in. When I'm at my parents' house and I'm on iChat with my b/f we are both perfectly clear (except one time he told me that I was pixelated to him), and they have Comcast internet with (I think) a NetGear wireless router. When I'm at my friend's house and chatting with him we are, again, perfectly clear, she has Verizon internet and no idea what kind of wireless router.
    This is why I'm so puzzled as to what could be causing my iChat to act like this. It has been this way since Day 1 when I got it back in March of this year.
    The other odd thing that just recently started happening was that when him and I are connected Safari runs at SLUGGISHLY slow speeds. Never had this problem before. Any files or program updates I'm trying to download go from a few minutes to days and hours, webpages won't load due to timing out, and the second we get disconnected the files download in minutes and seconds. This only started happening about a month ago, so I don't know what could have changed to affect that.
    The only two things I haven't swapped out are my actual modem and my MBP itself. I honestly doubt it is my MBP because anywhere else I connect everything is perfect, it's only when I am home that I experience problems. So I get that something is probably either setup incorrectly or defective with my equiptment. Has anyone else been having similar problems, or at least does anyone have any suggestions? (Ralph! **hint hint** :-D) Anything from anyone would be great and extremely appreciated. I fell in love with MAC a long time ago, and iChat was one of the great perks that it gave me, and I'd love to be able to use it at it's full potential again. Thanks again! Happy MAC-ing!

    You will see a drop if the computer is doing something on line at the time you test.
    However, normally you would see a drop in both figures.
    Did you try Defcom's suggestion of setting the iChat Bandwidth Limit to 200kbps ?
    IS this device set up to only allow the computer you want to access it ?
    Do the lights flash to indicate it is Busy even when you are apparently doing nothing ?
    I am wondering if someone else is logged on to your Wireless Network ?
    9:01 PM Sunday; July 6, 2008

  • Write some JAVA for me please, not working the way I wanted it too...

    Here's what I am getting when I go to run it:
    C:\Documents and Settings\Brad.HOME\Desktop\FINAL>java project1
    Usage: project1 [Array File Path]
    C:\Documents and Settings\Brad.HOME\Desktop\FINAL>
    What I need is for it to ask me to enter the location of the numbers file and then calculate the Max, Min, Mean, etc off of that file I enter in. Right now it just says:
    Usage: project1 [Array File Path]
    -------------------------------java below-------------------------------------------------
    import java.io.*;
    public class project1 {
    * Array File Path
    private String location;
    * set Location
    * @param location String
    public void setLocation(String location) {
    this.location = location;
    * Program initialization
    public project1() {
    int ar[] = new int[50];
    ReadFile(location, ar);
    sort(ar);
    System.out.println("Minimum= " + ar[0]);
    System.out.println("Maximum=" + ar[ar.length - 1]);
    System.out.println("Mean= " + mean(ar));
    System.out.println("Mode= " + modal(ar));
    System.out.println("Median= " + median(ar));
    System.out.println("Std Dev= " + stdDev(ar));
    * Main program
    * @param args String[]
    public static void main(String args[]) {
    if (args.length == 1) {
    new project1().setLocation(args[0]);
    else {
    System.out.println("Usage: project1 [Array File Path]");
    * Calculate the mean
    * @param ar int[]
    * @return double
    public double mean(int ar[]) {
    int sum = 0;
    for (int i = 0; i < ar.length; i++) {
    sum += ar;
    return (sum / ar.length);
    * Calculate the mode/modal
    * @param a int[]
    * @return int
    public int modal(int a[]) {
    int n;
    int freq = 0;
    int Mfreq = 0;
    int Mn = a[0];
    for (int i = 0; i < a.length; i++) {
    n = a[i];
    for (int j = 0; j < a.length; j++) {
         if (a[j] == n) {
         freq++;
    if (freq > Mfreq) {
         Mn = n;
    return Mn;
    * Calculate the median
    * @param a int[]
    * @return int
    public int median(int a[]) {
    if (a.length % 2 == 0) {
    int x = a[a.length / 2];
    int y = a[ (a.length + 2) / 2];
    return (x + y) / 2;
    else {
    return a[ (a.length + 1) / 2];
    * Calculate Standard Deviation
    * @param a int[]
    * @return double
    public double stdDev(int a[]) {
    int s2 = 0;
    int s = 0;
    for (int i = 0; i < a.length; i++) {
    s2 += (a[i] * a[i]);
    s += a[i];
    return Math.sqrt( (s2 - (s * 2) / a.length) / (a.length - 1));
    * Sort integer array
    * @param a int[]
    public void sort(int a[]) {
    int tmp;
    for (int i = 0; i < a.length; i++) {
    for (int j = 0; j < a.length; j++) {
         if (a[j] > a[j + 1]) {
         tmp = a[j];
         a[j] = a[j + 1];
         a[j + 1] = tmp;
    * Read integer array from specified file
    * @param filename String
    * @param ar int[]
    * @return int
    public int ReadFile(String filename, int ar[]) {
    File infile = new File(filename);
    int value, n = 0;
    try {
    BufferedReader reader = new BufferedReader(new FileReader(infile));
    String line = null;
    while ( (line = reader.readLine()) != null) {
         value = Integer.parseInt(line);
         ar[n++] = value;
    return n;
    catch (IOException e) {
    System.err.println("Problem reading input file!");
    System.exit(1);
    return n;

    Please use code tags when posting code. There is a
    button labeled code right above the text box
    where you type in your post.
    Your first problem occurs herepublic static
    void main(String args[]) {
    if (args.length == 1) {
    new project1().setLocation(args[0]);
    else {
    System.out.println("Usage: project1 [Array File
    y File Path]");
    }This code executes when you first launch the
    application. It checks to see if there were any
    arguments in the comman line. If the number of
    arguments is not equal to 1, then you get the Usage
    output. You must launch the program with one
    argument.I tried java project1 C:\\Temp.txt, but it still ends up with a NullException handler. I edited the code and added a catch for it so it returns File doesn't exist, but I swear it does and I'm pointing to it correctly...

Maybe you are looking for

  • How to get the last day of the payroll period

    Hi all, I need to get the last day of the payroll period e.g. last day of Jan 2007 is 31 Jan 2007. Can anyone suggest as to how to get it? Thanks, Madhu

  • Updating License Key!

    Hi, I need help knowing how to update a license key for BeBuzz. I recently got a new blackberry bold 9780, because my old one had water damage. It is the exact same phone, and I am using my old SIM card. I installed BeBuzz on my new phone, and typed

  • How to design a CDN ?

    hi all ! I need documents which guide us to design a Content Network, speacially How to choose CE ? thanks.

  • DateChooser with external xml

    Im a beginner with Flex. How do I connect an external xml to a DateChooser so every time a date is picked a value/or text (different for different dates) from the xml is passed into a textArea. In this case I want a value of "50" to be passed to the

  • MiniSAP login problem

    Hii All,       This is Dwaipayan... I have installed minisap 4.6c in my pc... my os is Win XP service pack 2.... i faced the follwing problem when i tried to logon..   description : MBS   application server : my pc name   sap syatem : R/3   system nu