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

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

Bookmark and Share

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

Issue No: 154 20 March 2003
12053 subscribers

"...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. What is the difference between applets loaded over the net and applets loaded via the file system?
  • 2. How do I encode a binary file before sending it and how do I decode it when I receive it?
  • 3. Latest posts on our message board
  • 4. Link to Java FAQ

  • Hello dear friends!

    Tip 1

    Question: What is the difference between applets loaded over the net and applets loaded via the file system?

    Answer: There are two different ways that applets are loaded by a Java system. The way an applet enters the system affects what it is allowed to do.

    If an applet is loaded over the net, then it is loaded by the applet class loader, and is subject to the restrictions enforced by the applet security manager.

    If an applet resides on the client's local disk, and in a directory that is on the client's CLASSPATH, then it is loaded by the file system loader. The most important differences are

    • applets loaded via the file system are allowed to read and write files
    • applets loaded via the file system are allowed to load libraries on the client
    • applets loaded via the file system are allowed to exec processes
    • applets loaded via the file system are allowed to exit the virtual machine
    • applets loaded via the file system are not passed through the byte code verifier
    • Java-enabled browsers use the applet class loader to load applets specified with file: URLs. So, the restrictions and protections that accrue from the class loader and its associated security manager are now in effect for applets loaded via file: URLs.

    This means that if you specify the URL like so:

    Location: file:/home/me/public_html/something.html

    and the file something.html contains an applet, the browser loads it using its applet class loader.

    From Java Applet Security FAQ

    Tip 2

    Question: How do I encode a binary file before sending it and how do I decode it when I receive it?

    Answer: You don't need to. JavaMail will automatically determine an appropriate encoding to use for your message parts before sending the message, and will automatically decode message parts when reading them. The getInputStream method will return the decoded data.

    Latest posts on our message board

    how to write into a file?!
    could anyone show me how to write into a file via a socket using client-server program ! ? ? thank you..
    topic here...

    Stop before shutdown
    Hi evebody,
    I need to stop the browser shutoff before close it (like when we close the Operating System and there is a modified document opened).
    Is there something like this?
    topic here

    banking system-please help!
    Hi everyone,
    I've got an assignment to hand in a week time, i was just wondering if anyone is willing to help me out with it.
    the problem iam facing at the moment is to take the input from a text field and insert it into a file.
    the whole program is about a banking system which the user is able to Credit, Debit and check the balance of his or her account. the following is the specification of the program.
    topic here....

    Database connectivity using J2EE Server
    Hello All,
    I'm using J2EE server (v1.3) , While connecting to the Sql Server 2000 / Oracle 8 database I'm getting an RMI Exception.
    If any of you have worked on similar lines.
    one more thing to add , It connects with cloudscape database very well. I know there is some discripnancy in my settings.
    Kindly guide me. Thanks in advance.
    topic here...

    Java File Explorer implementation
    Does anyone know where to get open source for a java implemented file explorer?
    topic here ...

    Capture and Management Key Event ...
    I'm writting a program for edit images. My problem is how to capture key events like 'ctrl+c' o something like this. I use a JFrame where are the menu options a menu bar and in others JWindows I paint and have a Tool window. The JFrame are the 'father' o this JWindows, of course. The problem is that I can't capture the key events anyway.
    I've tried two different ways. First, I thought, of course badly, to use this code in the JFrame:

    topic here...

    regexp problem - smallest possible match on string
    I need some help on simple regular expression.
    Just say I have a string for example:
    String str = "start start start match1 finish finish finish";
    I would like to extract the smallest string that is bounded by "start" and "finish"... ie. in this case I would like to extract the string "match1".
    My first guess was to use:
    pattern = "start (.*?) finish";
    however this matches the
    topic 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 autoresponder!

    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