Jump to content

  • Log In with Google      Sign In   
  • Create Account


[java] new at this stuff


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 a2k   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 June 2000 - 04:20 AM

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

Sponsor:

#2 joeG   Members   -  Reputation: 172

Like
Likes
Like

Posted 07 June 2000 - 04:54 AM

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

#3 a2k   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 June 2000 - 06:18 AM

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

#4 Smoo   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 June 2000 - 11:12 AM

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

#5 a2k   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 June 2000 - 05:00 PM

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


#6 Smoo   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 June 2000 - 08:42 AM

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.

#7 ManaSink   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 June 2000 - 09:39 AM

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

#8 ManaSink   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 June 2000 - 09:44 AM

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

#9 a2k   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 June 2000 - 12:09 PM

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

#10 javanerd   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 June 2000 - 11:03 PM

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.

#11 SteveMeister   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 June 2000 - 02:08 AM

Just in case you weren''t aware of this, you can view the contents of JAR files with WinZip...

In addition, if you use Sun''s Forte for Java IDE and add JAR files to your repository, you can expand them and view their contents in the repository tree control.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS