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

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

Bookmark and Share

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

Issue No: 165 20 May 2003
12893 subscribers

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

In this issue:
  • 1. The beta release of J2SE 1.5 is scheduled for late 2003. I have heard that there will be some changes in a code writing process that will make our life easier...
  • 2. I would like to create a class that can execute jscripts. Does any one know if there is such class?
  • 3. I work with RMI now and need to implement a new feature into software that was written by another people one year ago.
  • 4. Latest posts on our message board
  • 5. Link to Java FAQ

  • Hello dear friends!

    Tip 1

    Question: The beta release of J2SE 1.5 is scheduled for late 2003. I have heard that there will be some changes in a code writing process that will make our life easier...

    Answer: Yes, indeed. The improvements to J2SE being developed in project "Tiger" are intended to make programs clearer, shorter, safer, and easier to develop, without sacrificing compatibility. Java 1.5 will shift the responsibility for writing the boilerplate code from the programmer to the compiler...

    Instead of writing
    String title = ((String) words.get(i)).toUppercase();

    you will do like this:

    String title = words.get(i).toUppercase();
    and it will decrease the number of compile errors. Compiler will try to cast to String without saying it explicitly.

    More about all coming changes you can read in this excellent article:
    "New Language Features for Ease of Development in the Java 2 Platform, Standard Edition 1.5: A Conversation with Joshua Bloch" on:

    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 would like to create a class that can execute jscripts. Does any one know if there is such class?

    Answer: Yes, it is Rhino. Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users.
    Be aware that it has some limitations, Rhino is an implementation of the core language only and doesn't contain objects or methods for manipulating HTML documents.

    More read about Rhino here:

    Tip 3

    Question: I work with RMI now and need to implement a new feature into software that was written by another people one year ago. I need to find out: what is IP address of a client and then connect or reject the connection. I do not want to add methods to client... It must be the way how to find out it using RMI methods. Unfortunately I did not find with first attempt.

    Answer: Your RMI server extends UnicastRemoteObject that extends java.rmi.server.RemoteServer.
    That class (RemoteServer) has public static String getClientHost() method.
    When called from a thread actively handling a remote method invocation the hostname of the client is returned.

    Then use public static InetAddress getByName(String host) method of java.net.InetAddress
    Be aware that you do need to try to create an instance of InetAddress. It is static.
    Just get it!

    Latest posts on our message board

    Coming Sunday and Saturdays date

    How to get coming sundays date with respect to surrent date taking care of the month change leap year etc.

    thread is here ...

    Window resize

    Here is the scenario:

    I have a window that contains a table in a scrollpane,
    the window itself has a scroll pane, when I try to reduce the size of the window from right to left the scroll apne of the window
    will be displayed.

    What I want is the scrool pane of the table will be the one to resize no the scroll pane of the window

    Anyone can suggest how to prioritize the resizing of scroll pane?

    thread is here...

    Please help, java login script with jdbc:odbc


    Could some one please help me,
    i need a small example of a login code. The user and password is located in a Access database and the connection is jdbc dbc

    now i have to make a simple login script that asks the username and password, the username and passwordt have to machts one of the names and passwords from the database, if this name and password are found in the database the user goes to a nother page and send a URL code with it....

    Im looking for this script on the internet but i cant find any example, pleae help
    thread is here...

    EXCEPTION_ACCESS_VIOLATION error with Tomcat server

    I have a query regarding Tomcat server. I am running Tomcat 4.0 server. I have a login html page from where I am entering the valid id and password and submitting the form. As soon as I click on submit button an error occurs saying "An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x77fcab56" and server gets closed. I am not getting how to handle this error. Please tell the solution.

    thread is here...

    GUI - Repaint() - when will it end!!!!

    Hi there, looks like every java guy has to go thru this 1 gui/repaint() issue in life. so i am a member there.

    I have a qtn - like those countless folks out there - new to java and struggling with repaint() which dont seem to work. - can someone help? (thank you in advance).

    Heres the problem

    Have this drawing application with menus and stuff. so i draw box/lines/ circle etc. and when the mouse is released, i add the positions etc to an array, in my paint program, i parse thru the array and show the stuff. Now whatever i draw, doesnt appear immediately (although i have a repaint() (also tried validate, revalidate and every command i have learnt/come across).

    funny thing is, if i press my alt key, the "file" menu option will appear to be selected, when i press escape, the drawing window gets focus and immediately all my drawings appear. So my question, how do i make it do that.

    Additionally (while i am on the roll here) in my menu option i have a File/New when this is selected, i clear the array and do a repaint(). that works beautifully and all the drawing are gone. but if i click on a icon (designated as "new") that wont do anything until i go thru that pressing alt (or switching to another application using alt+tab and then coming back to my paint program).

    Any ideas?

    hoping to hear from someone.

    thread is here

    Input & Output

    how i was wondering how do you input a string from a file line by line which is delimited by (eg one:hello:crap) and is output to GUI ??

    FileReader reader = new FileReader("test.txt");

    BufferedReader in = new BufferedReader(reader);

    String inputLine = in.readLine();
    full thread is here

    an some one help me wih java sreen tips

    hello can some one tell me how an i create a java screen tip on a hyperlink ...
    i mean when ever some one brings his mouse over a link there should open a window in which there should b the information about the link ...

    thread is here

    fail Xrunhprof

    when i run a aplication with Xrunhprof and times option it appears a message in my console.
    "HPROF ERROR: stack underflow in method exit"
    "HPROF ERROR: thread local table NULL in method exit 006A629C"
    Does Somebody know whatґs up?

    thread is here...

    Embedding Fonts in Java

    Is there a way to embed fonts in to a java applet??
    If you can answer it would be greatly appreciated
    thread is here ...


    I have a problem regarding SunOne Application

    server7.0 installed on solaris5.8.
    I am getting 11000 records in the cached row set. But

    while populating the cached row set

    (crs.populate(resultset)) with the result set the

    server is real slow taking as long as half an hour for

    The same thing when run on weblogic6.1 on windows

    full thread is here ...

    How to disable a JApplet

    Hi guys,In my project,I need to disable my Japplet when browser start it,then after getting some information,I will enable it later;I try to use setEnable(false),but it doesn't work,the components inside my Japplet are still active,How can I do this by one method call or just no way to do it?Thanks

    thread is here ...

    need help

    I simply cannot set my OS to open JAR files with doubleclick. How can I set it to open with java.exe -jar.
    I am using WinXP

    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