Easy to Learn Java: Programming Articles, Examples and Tips

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


Code Examples

Java Tools

More Java Tools!

Java Forum

All Java Tips


Submit News
Search the site here...
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: 157

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

Bookmark and Share

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

Issue No: 157 April 1 2003
12242 subscriber(s)

"...if you have no mentors around in the initial stages."
"This book has saved me hours of research...""

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

In this issue:
  • 1. Has anyone found a way to produce a MS Word file with Java?
  • 2. I was looking at java.util.Timer class and there is no possibility to cancel an individual task. I have to cancel whole Timer with all my scheduled tasks... What is solution?
  • 3. ASP vs. JSP?
  • 4. Latest posts on our message board
  • 5. Link to Java FAQ

  • Hello dear friends!

    200+ Tips are ready!!!

    I keep my promises! I am glad to anounce that I am ready with my second free upgrade "200+ Java Tips" of my e-Book "500 Java Tips". This update includes first update "100+ Java Tips" as well. You do not need to read both of them just take latest one.
    Special heartfelt thanks to Dr. Heinz M. Kabutz. His advanced Tips section is excellent as always!

    Now both e-Books contain more 605 pages of A4 format pages. All my customers get already this update. Please send me your comments!

    It is not 1 April joke!

    I will not joke with you as Dr. Heinz M.Kabutz (check his newsletter below) did last year. In his newsletter he announced that all newsletter subscribers have to pay now to be unsubscribed and theirs credit cards will be charged automatically!

    One small anecdote by the way:

    - "Have you heard about the object-oriented way to become wealthy?"
    - "No..."
    - "Inheritance."

    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 1

    Question: Has anyone found a way to produce a MS Word file with Java?

    Answer: yes and it is free! Java bean word processing. It is an interface to control Microsoft® Word by java applications (includes German Version)

    Would you like to load Microsoft® Word, to create a new document and to serve bookmarks by your java application? There is a free java class for you here!

    Tip 2

    Question: I was looking at java.util.Timer class and there is no possibility to cancel an individual task. I have to cancel whole Timer with all my scheduled tasks... What is solution?

    Answer: The solution is in your question Smile you could develop a subclass of Timer that stores a list of all scheduled TimerTask instances. Then retrieve the instance that you want to cancel:

    TimerTask [] tasks = timer.getScheduledTasks();

    tip based on SUN's forum answer

    Tip 3

    Question: ASP vs. JSP?

    Answer: Comparing JSP with ASP

    Although the features offered by JSP may seem similar to that offered by Microsoft's Active Server Pages (ASP), they are fundamentally different technologies, as shown by the following table:

    JavaServer Pages Active Server Pages
    Web Server Support Most popular web servers including Apache, Netscape, and Microsoft IIS can be easily enabled with JSP. Native support only within Microsoft IIS or Personal Web Server. Support for select servers using third-party products.
    Platform Support Platform independent. Runs on all Java-enabled platforms. Is fully supported under Windows. Deployment on other platforms is cumbersome due to reliance on the Win32-based component model.
    Component Model Relies on reusable, cross-platform components like JavaBeans, Enterprise JavaBeans, and custom tag libraries. Uses the Win32-based COM component model.
    Scripting Can use the Java programming language or JavaScript. Supports VBScript and JScript for scripting.
    Security Works with the Java security model. Can work with the Windows NT security architecture.
    Database Access Uses JDBC for data access. Uses Active Data Objects for data access.
    Customizable Tags JSP is extensible with custom tag libraries. Cannot use custom tag libraries and is not extensible.

    Tip based on SUN's documnets

    Latest posts on our message board

    keep the size of a line even if the screen settings are change

    Hi, i have a weird things to do, and found nothing on google and others place...
    For example, i draw a line of 1 inch into my computer where my resolution is 96dpi and my screen area is 1024x768
    i need to made modification to this line to have a 1 inch line on every screen settings. example: my friend that are in 800x600 and have a dpi of 128 opn my program to see the line... i want him to see a 1 inch line too
    so i need to find a way to do that so when i have the screen size and the screen resolution that i could have on the screen a 1 inch (example) line for every settings...
    sorry for my english! can someone help me to find an idea...?
    thx a lot bumpert
    thread is here

    Check for Internet Connection

    Hi @all,

    In order to create a WildTangent-Intranet-Site, i want to check if my Server is connected to the WorldWideWeb or not via Java. The solution has to return only TRUE or FALSE! It must not open a window, cause an error or anything else that avoids a discrete check. It has to be just a stealth check.
    thread is here

    Swing and IE jvm


    I'm writing an applet in Swing, because it contains some nice controls (like JSpinner, JCombo, etc.). The only problem is that this does not seem to be compatible with the built-in JVM of Internet Explorer.

    There is of course a way to get IE download the "java plug-in", but this is not quite practical for me, as it downloads the whole JRE and installs it on the machine.
    Does anybody knwo of a way to compile a Swing applet so that it is compatible with the built-in JVM of IE (say as of IE5)?
    Thanks for your help! Eric.
    thread is here

    Problems with EventQueue and Modal Dialogs

    Hi, I have a problem as follows;

    What we did was to follow a Tech Tip, which can be found in this link;

    It automatically shows an hourglass cursor, when an event call does not return within a specified time (delay). It worked ok at the beginning BUT;

    The problem is, the code gets the system event queue like
    -- System.getDefaultEventQueue();
    and pushes another event queue instead of this one. The new queue is an instance of a WaitEventQueue class, which is very simple infact and does what I wrote above.
    After this new queue is pushed
    thread continues here

    Multiple Selection Drag n Drop w/ JTree

    Has anyone here implementing Multiple Selection Drag and Drop with JTrees? I know that there was a bug in JDK 1.3 that wouldn't allow it but I think that it would've been fixed in 1.4. So far I've implemented Single-Selection DnD but I don't know how to get Multiple Selection working.

    I know that the tree has to be set in either DISCONTIGUOUS_TREE_SELECTION or CONTIGUOUS_TREE_SELECTION, but I am unable to drag the nodes. How can I change my Single selection DragSourceListener and DropTargetListener so that it implements Multiple Selection?
    thread is here

    Changing file attributes

    Does anybody know how to change file attributes such as read and write in Java.
    thread is here

    Please ask your questions and help each other at our Java Forum:

    The Java FAQ Daily Tips is a newsletter that is only sent to those who have specifically subscribed to it (double opt-in).

    To subscribe/unsubscribe to "The Java FAQ Daily Tips" weekly edition newsletter visit our page here:

    If you have troubles please contact us: subscription@javafaq.nu

    Link to Java FAQ

    If you have added a link to http://javafaq.nu on your WEB-site, please let us know and you will get listed on our
    "pages linking to us" pages! If your page is a programming is programming relates you will of course get listed in the WEB-directory as well. Also, if you link to us, you have a chance to be listed in this newsletter as well.

    More information and graphics artworks can be found here


    For information on advertising on the Java FAQ's Daily Tips Newsletter, send an email to: adv@javafaq.nu
    You will get the answer immediately from auto responder!

    Send your comments, questions, praise and complaints to us: comments@javafaq.nu

    Copyright (c) 2000 - 2003 John Andersson, All rights reserved.

     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