Easy to Learn Java: Programming Articles, Examples and Tips

Start with Java in a few days with Java Lessons or Lectures

Home

Code Examples

Java Tools

More Java Tools!

Java Forum

All Java Tips

Books

Submit News
Search the site here...
Search...
 
Search the JavaFAQ.nu
1000 Java Tips ebook

1000 Java Tips - Click here for the high resolution copy!1000 Java Tips - Click here for the high resolution copy!

Java Screensaver, take it here

Free "1000 Java Tips" eBook is here! It is huge collection of big and small Java programming articles and tips. Please take your copy here.

Take your copy of free "Java Technology Screensaver"!.

Java Newsletters Archive: 168

JavaFAQ Home » Java Newsletters Go to all tips in Java Newsletters


Bookmark and Share

=== [ The Java FAQ Daily Tips, weekly publication ] ===

Issue No: 168 1 July 2003
13435 subscribers

Foreword: Excuse me for possible mistakes. English is not native language for me.

In this issue:
  • 1. Why does not exist "JavaNotFoundException"?
  • 2. I am sure that in my program I create 100 new threads and when I use isAlive method it shows often less than 100 threads... I have not killed even one of them!
  • 3. When I use Java to write my program under some specific OS,...
  • 4. Latest posts on our message board
  • 5. Link to Java FAQ

  • Hello dear friends!

    Tip 1

    Question: Why does not exist "JavaNotFoundException"?
    When I deliver my Java program to customers often Java is not installed on theirs machines. Having such exception I could in better form (GUI popup, for example) inform my customers about the problem...

    Answer: Is not it obvious that to be able to find the absence of Java with Java program you need Java Smile

    Java wimps please close your ears ... For the Java programmer who
    thought he knew everything there was to know about Java, have a
    look at the most advanced Java newsletter archived on the website
    http://www.smotricz.com/kabutz Guess what, it won't even cost you
    anything! Subscribe today - you won't be disappointed.


    Tip 2

    Question: I am sure that in my program I create 100 new threads and when I use isAlive method it shows often less than 100 threads... I have not killed even one of them!

    Answer: Good, short and clear explanation I found in Java tutorial on SUN's site:
    "The API for the Thread class includes a method called isAlive. The isAlive method returns true if the thread has been started and not stopped. If the isAlive method returns false, you know that the thread either is a New Thread or is Dead. If the isAlive method returns true, you know that the thread is either Runnable or Not Runnable. You cannot differentiate between a New Thread or a Dead thread. Nor can you differentiate between a Runnable thread and a Not Runnable thread."

    --
    John.


    Tip 3

    Question: When I use Java to write my program under some specific OS, I always set some environment variables to control the application program. For example, CLASSPATH.
    What is about other variables that I should be aware of? And how can I set them?

    Answer: Java defines own environment which is different from the default one provided by the underlying OS.

    You can define your own "environment" by using

    java -Dname1=myvalue1 -Dname2=myvalue2


    Latest posts on our message board
    bloking Java plugin in applet tog

    How can the default call of the java plugin on the applet tag be blocked so an applet can be run without the plugin. I have an applet that runs fine with out the plugin but stalls with it.
    help here


    Almost no hair left! NullPointerException in EventDispatchThread.

    I get this error after app has been running a while.
    What is the problem and where can I fix? It doesn't happen on my dev machine, but only on the production system.
    Help will be much appreciated!
    Quigrim

    java.lang.NullPointerException
    at javax.swing.plaf.basic.BasicProgressBarUI.getGenericBox(BasicProgressBarUI.java:477)
    continues here


    Java Web Start

    I have a problem with An Application that is launched by
    web-start.

    I would like to load class-files from jar's or zip-files that are
    not part of the spec. in the Applications jnlp-file.

    I can download the jar from a web-server and place the jar's/zip's in a catalog. And then try to instance the classes that i want from the jars/zips.
    I have tried to write my own class-loader. And it works ok if
    i run the application locally ( not from web-start ).
    continues here


    Watch Training Video on Enterprise JavaBeans For Free(DSL version)

    Hi all,
    We just posted new Training Video on Enterprise JavaBeans(DSL version),it may be helpful for you all.
    Thanks

    Direct Url:
    continues here


    Help in JTextPane

    Hi,

    I am displaying a html file in JTextPane, When I do changes in that file, click on send, These changes should be sent to other user which highlighted text which is changed, I know the highlighting part, but how to send only the changes which have been made, I don't know. I have implemented DocumentListener but I don't know why it is not responding when I attach a HTMLEditor kit with JTextPane
    help here


    JPanel on top of another JPanel

    I've got two JPanels. And I want to show one on top of the other:

    http://www.wflyers.nl/java.gif

    The red one has to be on top of the big bleu JPanel.
    I've tried JLayeredPane() already, but that failed.
    Does anyone has got an idea how to fix this problem.
    help here


    Updating randomAccessFile

    Hi again, ne wday new problem.
    I have a GUI that takes the attributes for a student, name, address etc and stores it to a random file. I everything works fine, but now I have to be able to update the information in the file. When I veiw the student information in the studentpanel, I should be able to edit the textfields and click on an update button that will update the file. I don`t want to append on to the existing file, I just want to overwrite it with the new information...at least thats what I think it should be doing.
    I created my update button and Now I am in the process of figuring out the actionevent for it,,,,except I do not have a clue, I havn`t even been able to find any basic examples of this.
    This is what I have so far.
     

    code:

    if (e.getSource() == jbtUpdate)
    continues here

     Printer Friendly Page  Printer Friendly Page
     Send to a Friend  Send to a Friend

    .. Bookmark and Share

    Search here again if you need more info!
    Custom Search



    Home Code Examples Java Forum All Java Tips Books Submit News, Code... Search... Offshore Software Tech Doodling

    RSS feed Java FAQ RSS feed Java FAQ News     

        RSS feed Java Forums RSS feed Java Forums

    All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest 1999-2006 by Java FAQs Daily Tips.

    Interactive software released under GNU GPL, Code Credits, Privacy Policy