Journal Articles

CVu Journal Vol 12, #3 - May 2000 + Programming Topics
Browse in : All > Journals > CVu > 123 (22)
All > Topics > Programming (877)
Any of these categories - All of these categories

Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles . The templates will get the extension .xt there.

Title: Java Q & A

Author: Administrator

Date: 03 May 2000 13:15:36 +01:00 or Wed, 03 May 2000 13:15:36 +01:00

Summary: 

Body: 

This month's Q&A section consists of some questions I posed on the accu-general mailing list as I began refreshing my limited Java knowledge, after having volunteered to take on this role. Please feel free to email me any questions you wish to ask here, or answers to previously asked questions. Thanks to everyone who contributed

Ed.

Questions and Answers

Question 1

Having used Java exclusively for noddy applets, using Sun's JDK, I'd now like to write a few "larger" more serious applications in Java, yet don't relish the idea of using command line tools, and not having a debugger of the "quality" (read feature set) of MSVC++. So what tools does everyone else use - both commercial tools and freeware/shareware (the cost is going to come out of my own pocket)?

Answer (Alan Bellingham)

Well - when I'm doing Java, I tend to end up using Borland's JBuilder. It's proper portable Java, rather than - ahem - MS J++. You'd want a fairly powerful PC, because being written pretty much in Java itself, it's not quite as responsive as an IDE compiled directly to native code. Version 3 is out, and I've not used that yet, so it may well have become more responsive if they got the JIT compiler working right.

Answer (David Williams)

A few ideas:

You can download an 100% Java version of JBuilder 3.0 from Inprise/Borland for free.

PC Plus frequently has JBuilder on their cover-disc.

The Borland IDE is decent. A lot of developers seem to prefer it to MSVC. I personally prefer Symantec Visual Cafe. I haven't seen a cover-disc version though.

Question 2

Threads - As Thread.stop() is deprecated (and a little heavy handed), what is the "correct" way to stop a thread?

Answer (Mark T. Kuschnir)

The docs say use some variable to tell the thread to end. I assume that this would normally be implemented using a method to set the flag that would be checked by the infinite run loop.

Answer (Hefin)

By having the thread drop out of its run method. If you want to stop it with a view to starting it again, then try using wait. Stopping a thread is described in the Sun Java Tutorial, check out: http://java.sun.com/ docs/books/tutorial/essential/threads/lifecycle.html

I've found the entire tutorial series that Hefin is referring to invaluable, I'd recommend downloading it if you are new to Java. Ed.

Answer (Steve Cornish)

The only true answer is to return from Thread.run().

Questions For Next Time

Question 1

What is a Java Bean, and why would I use one?

Question 2

I tried JBuilder, but it uses all these classes (JFrame, JApplet) etc. Is this Borland's proprietary API?

Question 3

Can I download a text file off a web server and display it in my applet, given they both have the same document base?

Notes: 

More fields may be available via dynamicdata ..