#### Archived

This topic is now archived and is closed to further replies.

# [java] new at this stuff

This topic is 6434 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

i'm very very new at java, and am wondering if you guys can tell me a few things. i have visual j++, and is this a good compiler, or are there better ones? and i've been browsing around some of the applet examples online, but have not been able to import this javax.swing.*, nor do i know what file, or file format these included libraries(?) are located at. i merely want to use functions like alphacomposite, japplet, jcomponent etc, Graphics2d, and other graphical methods, but can't seem to get it running in visual j++. are there perhaps some settings i need for visual? thanks a2k Edited by - a2k on 6/7/00 10:22:56 AM Edited by - a2k on 6/7/00 10:23:30 AM

##### Share on other sites
It''s awefully strange that you can''t import javax.swing.* Hmmm, ok did you check which version of the jdk your VisJ++ IDE supports. If it''s < jdk1.2 then check if you have the Java Runtime Environment. If you do then check if import com.swing.* works. If you do have a version of the jdk >= jdk1.2 then it''s probably an environment variable or setting that needs to be looked at.

Better recomendations follow:

If you have a *nix system you probably have emacs. There''s a java add-on to emacs called jde. If you have WinNT it''s still possible to use jde except that you''d have to get a bash shell for NT and probably a whole lot of other stuff.

Else, I liked JBuilder (JBuilder Foundation is free for *nix and NT, but not for Win95/98 so there''s a plus) alot, but believe it or not you need something > Celeron 400 w/ 64 MB RAM to run it at a pleasent rate of speed. I liked it because it had code completion. You''d have to give that up with emacs+JDE though, and VisualJ++ probably already has that.

Definitely look into getting a hold of a book (I learned by checking out a Java Graphics book at my local library and it still had a CD in it so I was able to get a copy of the jdk!!!!) or purchasing one. Also check out the trails at javasoft. They could be useful.

joeG

##### Share on other sites
exactly. i was working those trails, but had to get these stupid things compiled in visual. my version supports java 2, so i assume it's up to date. j++ 6. i'll play around with what you said. i'm sure it's a setting somewheres or other. thanks for the help, and i hope if i can't solve anything yet, you guys will be able to help me more. (i'm lookin' for myself too, i swear, buyin' books left 'n right)

is javax a file that i can find on my drive somewhere? i installed the jdk 1.3 i think it is on my system, and i also have 1.2.1, but is there a way to get visual j++ to have it find the javax library or something?

a2k

Edited by - a2k on June 7, 2000 2:20:23 PM

##### Share on other sites
A2k,

I am currently using vj++6.0 and the questions that you have asked about swing well it's definitely a good one that I've yet to get a solid answer on.

I have emailed %@#$MS support and believe me it IS a complete waste of time! I've emailed them at least 3 times and they've always pointed me back to their f**king web pages which don't have what I need (or at least I didn't find it). The best lead I have is I downloaded a little proggy found on their site. It's JPMExplorer.exe (Java package manager). This tool might come in handy but it definitely has a few bugs. If you do decide to use it and import packages a) you need to make sure the packages you import don't contain duplicate classes already with vj++ or else the jpmexplorer will crash. b) the packages have be either zip or cab files. It's not too hard too hard to convert jar files to zips. I converted everything from javax.* into a zip file and imported it. I copied a swing program (out of a book that *should* work and vj++ shot me an error: "An exception of type 'java.lang.NoClassDefFoundError' was not handled." And since I had copied the program out of a book, there are no errors there.. when clicking on the Ok button it asked for SwingUtilities.java. I have no clue what this is. perhaps it is a part of the swing package that I missed but I *did* import the entire javax.* directory so I'm at a loss. There is one thing I did not do however and that was remove all the packages that show up in the jpmExplorer and create a zip of all java packages in one... perhaps that would work but I don't know. If you find any more info, please share it. If not anyone else, I would be happy. I'll do the same. Smoo P.S. Since you were wondering where to find the javax packages, I just took the scr.jar file that came with Sun's jdk1.2, unjared it and zipped the components needed. Edited by - Smoo on June 7, 2000 9:59:36 PM #### Share this post ##### Link to post ##### Share on other sites aha! thanks. how did you know it was scr.jar that had javax.*? and perhaps i will keep trying, but i have other things goin'' right now, so i''m not spending my full efforts on it. a2k #### Share this post ##### Link to post ##### Share on other sites To answer your question on which jar had javax well, the most likely solution is that src.jar was something like 10 or 14MB Good luck, Smoo. #### Share this post ##### Link to post ##### Share on other sites I don''t use VJ++, as I am not a big fan of M$ java, (Sun took them to court over Java =P ), but I can offer the following info about Sun''s jdks:

packages that begin with java.* are standard libraries that are (typically) included with the runtime environment. As such, in Java2 environments, 1.20+, you do not need to do anything to use them. If your compiler can''t find them, the source code is usually in the /src.jar and the compiled classes are usually in the /jre/lib/rt.jar Including the rt.jar will allow you to compile your stuff, and its always good to peek at the source code. In 1.1.6 you will need to place the rt.jar on your classpath.

javax.* are standard java extensions (not just swing either), and do not always come with your runtime environment. Swing DOES come in 1.20+, so the above rules apply. Other extensions are usually downloaded and placed in the /jre/lib/ext/ directory, but you probably won''t use any of these.

I would recommend spending a lot of time at java.sun.com. While you are there, you might check out Forte, Sun''s free IDE. It is written in Java, so it will run on Win95/98/2000/NT, Solaris, Linux. It is a little slow, and is a 1.0 release (a touch buggy), but the price is right, and Sun plans on releasing the source code. It also has code completion, an open API for designing your own plugins.... (I think JBuilder and VisualAge for Java are decent as well.)

ManaSink@hotmail.com

##### Share on other sites
Actually, looking back at my post, I wasn''t too clear. The runtime environment is for execution only, the JDK is the java development kit that includes a runtime engine and compiler/development tools...

Sun''s stuff:
1.20+ Runtime Environ. has the rt.jar (.class only)
1.20+ JDK has the src.jar and the rt.jar (.java only)

Swing stuff should be in both.
Damn I''m tired. It all starts to run together after a rough day...

ManaSink

##### Share on other sites
thanks, guys. i think i''m gonna use jbuilder, and visual for some other time, since i bought it. (i just like the visual IDE. it''s really nice, and i hope jbuilder is almost if not as good.)

a2k

##### Share on other sites
I''ve been wondering if the J++ 6.0 would work with class libraries from Java 2. I used to use (back when I had to work with J++) the JDK 1.1 version of Swing/JFC, but I don''t know if it is still being updated by JavaSoft. At least Microsoft should have JNI implemented in their newest Java VM''s and compilers. So theoretically you should be able to use the JavaSoft provided libraries for Java 2 with a patched up (updated runtime + compiler) J++.

Keep us updated if you have any success with this.

That SwingUtilities is a class in javax.swing package that has some usefull functions like invokeLater() that allows you to use the UI thread to execute things etc.