Results 1 to 17 of 17
  1. #1
    dauphin is offline Member
    Join Date
    Dec 2010
    Posts
    10
    Rep Power
    0

    Default SpinnerNumberModel source

    Hi,

    Apparently the source for SpinnerNumberModel class is not found and so the methods containing it are not run properly. What should I do? (I use Eclipse Kepler and JRE 1.6).

    P.S. There are some "source" files on the web, can I use them? If yes, how?

    Thanks.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default Re: SpinnerNumberModel source

    Why should you want the source code of that class? Simply import it from the javax.swing package (or press Cntrl-Shift-O in your Eclipse editor; it'll import everything for you).
    kind regards,

    Jos

    ps. the source code of that class is in the src.zip archive in your SE JDK installatioon.
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    dauphin is offline Member
    Join Date
    Dec 2010
    Posts
    10
    Rep Power
    0

    Default Re: SpinnerNumberModel source

    Thanks for the reply.

    I found the problem anyway. It was my fault that I mistook the order of the constructor's arguments (min,max,val instead of val,min,max).

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default Re: SpinnerNumberModel source

    Quote Originally Posted by dauphin View Post
    Thanks for the reply.

    I found the problem anyway. It was my fault that I mistook the order of the constructor's arguments (min,max,val instead of val,min,max).
    All three parameters have the same type, so the constructor would've worked, so I don't understand what made you think that the source or compiled class were absent ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,779
    Rep Power
    5

    Default Re: SpinnerNumberModel source

    How much you want to bet the OP got an IllegalArgumentException from the invariant checking? Difficult to know since the error message wasn't posted.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default Re: SpinnerNumberModel source

    Quote Originally Posted by jim829 View Post
    How much you want to bet the OP got an IllegalArgumentException from the invariant checking? Difficult to know since the error message wasn't posted.
    I that case the constructor would've done its job and the OP would'be gotten what he deserved; that behaviour still doesn't explain the absence of the class.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    dauphin is offline Member
    Join Date
    Dec 2010
    Posts
    10
    Rep Power
    0

    Default Re: SpinnerNumberModel source

    Quote Originally Posted by JosAH View Post
    All three parameters have the same type, so the constructor would've worked, so I don't understand what made you think that the source or compiled class were absent ...

    kind regards,

    Jos
    The EventDispatcher thread gave me the error message "source not found" on the class construction line, and there was a button below it for navigating classes and folders. That gave me the impression the source of the class was missing (although I was wondering how the missing source effects on the compiled code). That impression was reinforced when I couldn't find the source for that class anywhere in my PC (I don't even have JDK src.zip as you said). Anyway, when I checked the console log and saw clearly that the condition "min <= value <= max" is not fulfilled, I got suspicious of mis-ordering the arguments.

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default Re: SpinnerNumberModel source

    Quote Originally Posted by dauphin View Post
    The EventDispatcher thread gave me the error message "source not found" on the class construction line, and there was a button below it for navigating classes and folders. That gave me the impression the source of the class was missing (although I was wondering how the missing source effects on the compiled code). That impression was reinforced when I couldn't find the source for that class anywhere in my PC (I don't even have JDK src.zip as you said). Anyway, when I checked the console log and saw clearly that the condition "min <= value <= max" is not fulfilled, I got suspicious of mis-ordering the arguments.
    You've been banging your keyboard without knowing what you did: you wanted Eclipse to show the definition of a method etc. of the SpinnerNumberModel class; Eclipse couldn't find the source (because you hadn't told it where to look for the sources); this is a typical case of not reading any manual pages and spreading myths if things don't work as you had hoped; every Oracle JDK comes with a src.zip file.

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    dauphin is offline Member
    Join Date
    Dec 2010
    Posts
    10
    Rep Power
    0

    Default Re: SpinnerNumberModel source

    Quote Originally Posted by JosAH View Post
    You've been banging your keyboard without knowing what you did: you wanted Eclipse to show the definition of a method etc. of the SpinnerNumberModel class; Eclipse couldn't find the source (because you hadn't told it where to look for the sources); this is a typical case of not reading any manual pages and spreading myths if things don't work as you had hoped; every Oracle JDK comes with a src.zip file.
    Whether you believe it or not there was no single "src.zip" in my PC, neither in jdk folder (v1.7.0-45) nor any other place. Therefore, no matter if I told it where to search for the source, it couldn't find sth which didn't exist. Maybe I'd deleted "src.zip" and I don't remember when and why, or maybe that "every Oracle JDK comes with a src.zip file" is a myth.

    Thanks anyway.

  10. #10
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default Re: SpinnerNumberModel source

    This is part of the readme documentation:

    Source Code
    (In src.zip) Java programming language source files for all classes that make up the Java core API (that is, sources files for the java.*, javax.* and some org.* packages, but not for com.sun.* packages). This source code is provided for informational purposes only, to help developers learn and use the Java programming language. These files do not include platform-specific implementation code and cannot be used to rebuild the class libraries. To extract these file, use any common zip utility. Or, you may use the Jar utility in the JDK's bin/ directory:

    jar xvf src.zip
    I think it is extremely unlikely (to say the least) the your copy of the JDK didn't come with the sources; much more likely is that you don't know what you're doing

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  11. #11
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,098
    Rep Power
    6

    Default Re: SpinnerNumberModel source

    Isn't it possible to choose not to install it in the custom installation path? In any case, arguing about it is a bit fruitless. At this point it is in your interest to get a JDK in which the src.zip DOES exist.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  12. #12
    dauphin is offline Member
    Join Date
    Dec 2010
    Posts
    10
    Rep Power
    0

    Default Re: SpinnerNumberModel source

    Quote Originally Posted by gimbal2 View Post
    Isn't it possible to choose not to install it in the custom installation path? In any case, arguing about it is a bit fruitless. At this point it is in your interest to get a JDK in which the src.zip DOES exist.
    I've already downloaded the latest version (7u51) which includes "src.zip". I also reinstalled my old version (7u45). It is a Netbean bundle, and as I said it doesn't include "src.zip" (I didn't find a related installation option).
    This link (the last file on the list for x64) is probably the same old update I'd downloaded from Oracle (based on the file name, size and date).

  13. #13
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default Re: SpinnerNumberModel source

    In the Java SE JDK distribution (with Netbeans), the src.zip file is explicitly mentioned (it would be extremely silly not to include that file with the distribution ...)

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  14. #14
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,098
    Rep Power
    6

    Default Re: SpinnerNumberModel source

    Oi, where are the kind regards?

    PS:
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  15. #15
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default Re: SpinnerNumberModel source

    Quote Originally Posted by gimbal2 View Post
    Oi, where are the kind regards?

    PS:
    Hey, where did you get those from? You didn't nose around in my fridge did you?

    kind regards,

    Jos

    ps. I'm getting a bit sick and tired of those peope who are too stubborn to admit that they don't know what they're doing; banging their keyboards and then they come over here to complain ...
    cenosillicaphobia: the fear for an empty beer glass

  16. #16
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,098
    Rep Power
    6

    Default Re: SpinnerNumberModel source

    In any other thread I would agree with you, but in this thread I'd only agree with you if I myself would install the bundle package (which I won't) and then see if the src.zip is there or not. until then I have to give the benefit of the doubt to the OP.

    Blegh, I'm lecturing again. Weekend!
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  17. #17
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,779
    Rep Power
    5

    Default Re: SpinnerNumberModel source

    Quote Originally Posted by gimbal2 View Post
    (which I won't)
    I did. It's not there (or my Windows search can't find it). At least not the src.zip file which normally comes bundled with the SE JDK.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. Web : frame source, not page source
    By FunkyProg in forum New To Java
    Replies: 0
    Last Post: 03-30-2011, 12:49 AM
  2. Jsp source not found
    By jadeite100 in forum Web Frameworks
    Replies: 2
    Last Post: 01-19-2010, 02:23 PM
  3. python source to java source converter?
    By conor147 in forum New To Java
    Replies: 0
    Last Post: 01-15-2010, 05:14 AM
  4. Replies: 0
    Last Post: 01-29-2009, 10:43 AM
  5. Replies: 1
    Last Post: 11-28-2008, 06:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •