• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Code for basic java classes

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone know where you can get the code for the basic java classes. I am espically interested in the AWT componets, but hoping to find everything.
Thanks
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Matthew,
If you mean the API source code, then you should be able to find it in your JDK directory. All source code is in src.jar.
Watch out! Do not decompress the files in the same directory.
------------------
Hope this helps.
Have a good day.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can go to the following link to the sun page for JavaTM 2 SDK, Standard Edition Documentation, click on the download page and get all the classes including the AWT.
Download to your harddrive, set you path and classpath, and you are in business. http://java.sun.com/j2se/1.3/docs/index.html
You might want to be aware the the new swing components are (slowly) replacing the AWT because the AWT components are "heavyweight" (they have peer components on the operating system side) and the swing components available in the 1.2 release are "lightweight" components (they are completely separated from the operating system).
In addition to using less system resources, the swing components look alike on any operating system while the AWT component pick up the look and feel of the underlying operating system (i.e. a button on windows will look like a windows button. They same button on motif will look different - more like a motif button).
 
Matthew Jones
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, I was able to find the files in src.jar and decompress to read the source.
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've extracted all the files from src.jar with the command: jar xvf src.jar and it does give me all the .java files but I cannot really make any sense of them. To me, they look more like .class files than source code. I tried to paste a small snippet of Number.java here:
public abstract long longValue(); /**

...but none of the illegible stuff would transfer to this text area (all those litte squares). Is there another process that I need to put the files through before I can understand them?
 
Steven YaegerII
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Never mind, it turns out that the files were just unreadable in NotePad but they are easy to read if you use Word. At first, I didn't think I was getting all that there was because when I'd copy & paste the source code, those little squares would disappear. I've only looked at a few files so far, and they look pretty empty without all those comments, but I think I got it now.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would suggest using a Java editor. JCreator Pro is a good one.
 
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic