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: 158

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


Bookmark and Share

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

Issue No: 158 April 3 2003
12242 subscriber(s)
   
 

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

In this issue:
  • 1. I often hear something like this "daemon runs" or "how to make my own daemon"...
  • 2. How can I convert any Java Object into byte array?
  • 3. Latest posts on our message board
  • 4. Link to Java FAQ

  • Hello dear friends!

    Tip 1

    Question: I often hear something like this "daemon runs" or "how to make my own daemon"...
    Is not it the same daemon and application? They are both executable. What is difference between daemons, services and applications?

    Answer: In UNIX terminology, applications that provide services rather than directly communicate with users are called daemons. For example network, printer services and so on...
    They do not need any direct interaction with user and run in background, invisible for GUI users.
    In Windows the same concept is known as a service.
    So, if you can not communicate with application that you develop and it is invisible - you can surely call it daemon or service, until all bugs are fixed Smile


    Tip 2

    Question: How can I convert any Java Object into byte array?

    Answer: Very elegant way I found on SUN's web site:
    public static byte[] getBytes(Object obj) throws java.io.IOException{
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(bos);
    oos.writeObject(obj);
    oos.flush();
    oos.close();
    bos.close();
    byte [] data = bos.toByteArray();
    return data;
    }


    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

    Hello,

    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;
    http://www.javaworld.com/javaworld/...-javatip87.html

    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

    Hello,
    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:
    http://javafaq.nu/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:
    http://www.javafaq.nu/plm2html/my_subscription.shtml

    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
    http://javafaq.nu/other/linktous.shtml


    Advertising

    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