Localization changes in J2SE 5

Hi,
I have come across some changes in the localization support in J2SE 5. JSR 204 and corresponding API changes.
Does this mean that if we use char sequence based APIs then there is no other change required ?
Do all functions( string comparisons etc. ) already have support for multi-lingual facilities ?
Basically the following is already taken care of in J2SE 5 ?
"You should be aware that internationalization and localization issues of full Unicode strings are not addressed with [String] methods. For example, when you're comparing two strings to determine which is 'greater', characters in strings are compared numerically by their Unicode values, not by their localized notion of order."
Thanks
Mohan

I think in addition to what I have written we have to use the unicode format( 'U' followed by a hex digit ) in .properties files. Is this a general practice or only for supplementary characters ?
Thanks,
Mohan

Similar Messages

  • Arabic localization changes don't change the left to right Alignment

    Hi all,
    We are using localization for our application and the supported locales (registered in faces-config.xml) are English and Arabic. When the language is changed as per user preferences , the corresponding Arabic values are read from the bundle properties, but the alignment for page and menu is not changed form left-right to right to left automatically.
    Code for locale change is given as :
    FacesContext.getCurrentInstance().getViewRoot().setLocale(new Locale(LANGUAGE_AR));
    Also tried the following entry in the trinidad-config.xml
    <right-to-left>
    #{view.locale.language=='ar' ? 'true' : 'false'}
    </right-to-left>
    Please let me know , if I am missing something to achieve the alignment change
    thanks
    JZWL

    Hi,
    Try : <fo:block text-align="right">Your text here</fo:block>
    Regards,
    Colectionaru

  • RTF Printing in J2SE 5

    Hi,
    We are experiencing problems with printing RTF documents in J2SE 5. Our applications prints as expected on J2SE 1.4 but running the same application on J2SE results in output that is looking akward since character spacing is wrong.
    I have created a small sample application to show the problem. Compile it for J2SE 1.4 and run it using both version 1.4 and 5 and compare the output.
    Does anyone know about any changes in J2SE 5 that should cause this behaviour - or perhaps someone could spot the problem? Any help would be appreciated.
    SAMLE APPLICATION:
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import java.awt.print.*;
    import javax.swing.plaf.basic.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.event.*;
    import javax.swing.text.rtf.*;
    import javax.swing.undo.*;
    public class RTFExample {
        private static final String RTF = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1030{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0 Arial;}}\\viewkind4\\uc1\\pard\\sb100\\sa100\\f0\\fs22 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam tortor nunc, elementum quis, tincidunt non, lacinia non, sapien. Cras pulvinar, ipsum sed imperdiet tristique, justo felis eleifend felis, eget porttitor nunc nisl vel sapien. Vestibulum eu quam quis nisl feugiat sagittis. Quisque convallis. Cras pede. Mauris risus nisi, tincidunt ut, vehicula quis, posuere in, elit. Mauris tempus leo ut mi. Nulla non sem. Suspendisse nec eros vitae turpis condimentum pulvinar. Fusce tortor lacus, egestas gravida, mollis et, ornare et, augue. Nulla consequat, turpis id fermentum tincidunt, turpis nunc facilisis libero, ut consectetuer diam lorem nec enim. Sed quis urna. In vel felis eget nibh semper porttitor. Nulla convallis consequat quam. Suspendisse at ipsum eget tortor vestibulum pellentesque. In hac habitasse platea dictumst. Pellentesque in sem sed dolor laoreet volutpat. Curabitur eleifend lobortis sapien. Vivamus tellus sem, consequat at, suscipit adipiscing, dapibus non, magna. Sed quam purus, faucibus quis, molestie ac, commodo a, tortor.\\par}";
        public static void main(String[] args) {
         GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
         RTFExample t = new RTFExample();
         t.printData();
        public void printData() {
         try {
             TestRTFRenderer renderer = new TestRTFRenderer();
             JTextPane tp = new JTextPane();
             renderer.setpane(tp);
             EditorKit rtfek = tp.createEditorKitForContentType("text/rtf");
             tp.setEditorKit(rtfek);
             StyleContext ctx = new StyleContext();
             DefaultStyledDocument d = new DefaultStyledDocument(ctx);
             tp.setDocument(d);
             rtfek.read(new StringReader(RTF), d, 0);
             PrinterJob prnJob = PrinterJob.getPrinterJob();
             PageFormat format = prnJob.pageDialog(prnJob.defaultPage());
             prnJob.setPrintable(renderer, format);
             if (prnJob.printDialog() == false) {
              return;
             prnJob.print();
         } catch (Exception e) {
             e.printStackTrace();
    class TestRTFRenderer implements Printable {
        // This external class that does all the printing of all the rtf document pages
        int currentPage = -1;
        JTextPane jtextPane = new JTextPane();
        double pageEndY = 0;
        double pageStartY = 0;
        boolean scaleWidthToFit = true;
        int currentIndex = 0;
        public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) {
         // This function is the main printable overided function
         double scale = 1.0;
         Graphics2D graphics2D;
         View rootView;
         graphics2D = (Graphics2D) graphics;
         jtextPane.setSize((int) pageFormat.getImageableWidth(), Integer.MAX_VALUE);
         jtextPane.validate();
         // I think the error is somwhere here
         rootView = jtextPane.getUI().getRootView(jtextPane);
         if ((scaleWidthToFit) && (jtextPane.getMinimumSize().getWidth() > pageFormat.getImageableWidth())) {
             scale = pageFormat.getImageableWidth() / jtextPane.getMinimumSize().getWidth();
             graphics2D.scale(scale, scale);
         // The below four command lines shows that the content is clipped
         // to the size of the printable page
         graphics2D.setClip((int) (pageFormat.getImageableX() / scale), (int) (pageFormat.getImageableY() / scale), (int) (pageFormat.getImageableWidth() / scale), (int) (pageFormat.getImageableHeight() / scale));
         // The below if statement is to check to see if there is a new page to render
         if (pageIndex > currentPage) {
             currentPage = pageIndex;
             pageStartY += pageEndY;
             pageEndY = graphics2D.getClipBounds().getHeight();
         graphics2D.translate(graphics2D.getClipBounds().getX(), graphics2D.getClipBounds().getY());
         Rectangle allocation = new Rectangle(0, (int) -pageStartY, (int) (jtextPane.getMinimumSize().getWidth()), (int) (jtextPane.getPreferredSize().getHeight()));
         // The below if else statements return PAGE_EXISTS only if the class
         // sees that there are some contents in the document by calling the printView class
         if (printView(graphics2D, allocation, rootView)) {
             return PAGE_EXISTS;
         else {
             pageStartY = 0;
             pageEndY = 0;
             currentPage = -1;
             currentIndex = 0;
             return NO_SUCH_PAGE;
        protected boolean printView(Graphics2D graphics2D, Shape allocation, View view) {
         // This function paints the page if it exists
         boolean pageExists = false;
         Rectangle clipRectangle = graphics2D.getClipBounds();
         Shape childAllocation;
         View childView;
         if (view.getViewCount() > 0) {
             for (int i = 0; i < view.getViewCount(); i++) {
              childAllocation = view.getChildAllocation(i, allocation);
              if (childAllocation != null) {
                  childView = view.getView(i);
                  if (printView(graphics2D, childAllocation, childView)) {
                   pageExists = true;
         else {
             // The below if statement checks if there are pages currently to paint
             if (allocation.getBounds().getMaxY() >= clipRectangle.getY()) {
              pageExists = true;
              if ((allocation.getBounds().getHeight() > clipRectangle.getHeight()) && (allocation.intersects(clipRectangle))) {
                  view.paint(graphics2D, allocation);
              else {
                  if (allocation.getBounds().getY() >= clipRectangle.getY()) {
                   if (allocation.getBounds().getMaxY() <= clipRectangle.getMaxY() - 15) {
                       view.paint(graphics2D, allocation);
                   else {
                       if (allocation.getBounds().getY() < pageEndY) {
                        pageEndY = allocation.getBounds().getY();
         return pageExists;
        public void setpane(JTextPane TextPane1) {
         // This function gets the JTextPane
         jtextPane.setContentType("text/rtf");
         jtextPane = TextPane1;
    }

    mpogra, welcome to the forum. Please don't post in threads that are long dead. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
    I'm locking this thread now.
    db

  • J2EE & J2SE install questions

    I downloaded and installed this release on my Windows XP machine. The name of the install-executable is j2eesdk-1_4-dr-windows-eval.exe.
    In the download website, it said this includes J2SE 1.4.2_02 also, although after installation, none of the online documentation for J2SE seems to be present, only J2EE-specific ones (includng EJB, security, server, web, etc) are present.
    Do I need to install the J2SE SDK separately to get access to the regular J2SE code and documentation? Or, is this all comes with the J2EE SDK?
    Also, when I install the J2EE SDK, it default-installs into C:\Sun\AppServer. When I install J2SE SDK, it default-installs into C:\j2sdk1.4.2_03 and also installs something into C:\Program Files\Java\... Why this inconsistency? Is the C:\Program Files\Java\... piece just the JRE? If so, why doesn't the J2EE install also install a JRE this way?

    So, you have J2EE SDK already installed, and you want to use another J2SE version that you installed separately, right?
    To do that, you should update <j2EE_install_dir>/config/asenv.bat file. Variable AS_JAVA should point to new J2SE installation directory. Then, you also need to change the J2SE installation used by default server domain - easiest way to do that is to use admin console and follow instructions available here:
    http://docs.sun.com/source/817-6088/jvm.html#wp1027918

  • Compilation with packages is different in J2SE 1.4.1 ?

    Hi there !
    I've just installed J2SE 1.4.1_01 in my Win NT 4.0 computer.
    Some of the files that belong to packages compiled just fine with JDK 1.2.2 but don't compile with J2SE 1.4.1_01.
    The same is true when I try to compile Java2D in the demo\jfc directory.
    In project NumberFormatTest I have the following classes:
    =====================================================================
    d:\MyPrograms\Java\NumberFormatTest\NumberFormatTestFrame.java
    package NumberFormatTest;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.text.*;
    import java.util.*;
    import tools.*;
    public class NumberFormatTestFrame extends Frame
    implements ActionListener, KeyListener, WindowListener
    =====================================================================
    d:\MyPrograms\Java\Tools\JCTextField.java
    package tools;
    import java.awt.*;
    public class JCTextField extends TextField
    =====================================================================
    d:\MyPrograms\Java\Tools\JCDecimalTextField.java
    package tools;
    import java.text.*;
    import java.util.*;
    public class JCDecimalTextField extends JCTextField
    d:\MyPrograms\Java>javac Tools\JCTextField.java
    compiles OK
    d:\MyPrograms\Java>javac Tools\JCDecimalTextField.java
    does not compile successfully with the error,
    Tools\JCDecimalTextField.java:67: cannot resolve symbol
    symbol : class JCTextField
    location: class tools.JCDecimalTextField
    public class JCDecimalTextField extends JCTextField
    pointing to the J in JCTextField
    d:\MyPrograms\Java>javac NumberFormatTest\NumberFormatTestFrame.java
    also doesn't compile with with "cannot resolve symbol" errors, when it tries to use JCDecimalTextField.
    It seems to me that classes defined by me to extend another class defined by me (JCDecimalTextField) and inside a package (tools) aren't being found by javac.
    However JCTextField is defined by me, extends TextField (from java.awt.*), is inside package tools and compiles OK.
    This stuff didn't happen in JDK 1.2.2.
    What the hell has changed with J2SE 1.4.1 ???
    My PATH has C:\Program Files\jdk\bin (among other directories)
    My CLASSPATH is
    D:\MyPrograms\Java;C:\Program Files\jdk\lib\tools.jar;C:\Program Files\Java\j2re1.4.1_01\lib\rt.jar;.;
    I strongly suspect that something has changed after JDK 1.2.2 in the way packages are handled by javac. I've tried searching in forums and other sun java documentation but couldn't find an answer to my problem.
    Can anyone please help me ?
    Any hint, suggestion or Internet site with appropriate documentation, would be highly appreciated as a means to end this 2 day nightmare.
    Thanks in advance,
    MGoncalv

    This issue has already been solved.
    J2SE 1.4.1 is case sensitive with regard to package directories.
    My tools package files must in subdirectory tools (but not Tools).
    This problem didn't happened with JDK 1.2.2
    For more details please take a look at
    Cannot resolve symbol
    from Feb 10, 2003 11:46
    by MGoncalv

  • J2EE or J2SE Install?

    I'm trying to updating my JBuilder JDK but don't know which JDK to install?
    Do I install the J2EE JDK or the J2SE JDK?
    Does the J2EE JDK have access to all the classes that the J2SE JDK has?

    So, you have J2EE SDK already installed, and you want to use another J2SE version that you installed separately, right?
    To do that, you should update <j2EE_install_dir>/config/asenv.bat file. Variable AS_JAVA should point to new J2SE installation directory. Then, you also need to change the J2SE installation used by default server domain - easiest way to do that is to use admin console and follow instructions available here:
    http://docs.sun.com/source/817-6088/jvm.html#wp1027918

  • Deploy issue from JDeveloper 10.1.3.5 to OAS 10.1.2

    I have written an application using ADF on JDeveloper 10.1.3.5 and need to deploy it to our OAS 10.1.2. I have run the adfinstaller on the linux server to upgrade the ADF libraries to the correct versions, updated the web.xml files to have the correct versions, changed to J2SE 1.4.2_19 for the application and have still got deployment issues.
    Error
    An error occurred while redeploying application "FormsSiebelIntegration". See base exception for details.
    Resolution:
    See base exception for details.
    Base Exception:
    java.lang.UnsupportedClassVersionError
    com/sun/faces/application/ApplicationAssociate (Unsupported major.minor version 49.0). com/sun/faces/application/ApplicationAssociate (Unsupported major.minor version 49.0)
    Removing the jsf-impl.jar file allows the application to deploy, but when running on the app server I get the following errors:
    OracleJSP: oracle.jsp.parse.JspParseException:
    /codename.jspx: Line # 6, <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces" xmlns:afh="http://xmlns.oracle.com/adf/faces/html">
    Help! I'm starting to have total mind block as to what to do next.
    Error: Unable to load taghandler class: http://java.sun.com/jsf/html

    I had already applied all of this before trying to deploy.
    The error seems to be a versioning error in the jsf-impl.jar file as the ApplicationAssociate class is found there. I have changed the JDK and J2EE to 1.4.2 and 1.3 respectively, rebuilt everything, updated all the settings to the right versions for 10.1.2 but it still keeps failing on the deploy.

  • Java Stored Procedure Problem

    Hi all,
    I was able to deploy the Java class into the database (the message says Success). And then I am able to desc MyJavaSproc name in SQL*Plus and see the Pl/SQL parameter and return types. But when I use either call or select from dual, it tells me the the Java class (MyJavaName) is not there. The Oracle error is this: ORA-29540: class MyJavaName does not exist. I am running 10gR2. I did encounter a problem when I first tried to deploy using J2SE 1.5 as source and target and JDev suggested that I change that to an earlier version. I changed that to 1.4 and then deployed successfully.
    Could someone help me with this? Thanks a lot.
    Ben

    Thanks. I created a simple file Java class with JDev (10g 1.3). I have some static methods (according to Oracle docs) in the class. Then by following JDev's help doc, I created a deployment profile for the project using JDec. I then added the Java methods that I wanted to deploy as sprocs. As I said, after I changed the J2SE from 1.5 (the default) to 1.4, the deployment was successful. I can see it using desc in SQL*Plus. I can also see it in the database connection tab in JDev. I can open the class stub created by JDev, and the sprocs and funcs are listed under Functions and Procedures on the database connection tab.
    Thanks.
    Ben

  • "catch is unreachable" compiler error with java try/catch statement

    I'm receiving a compiler error, "catch is unreachable", with the following code. I'm calling a method, SendMail(), which can throw two possible exceptions. I thought that the catch statements executed in order, and the first one that is caught will execute? Is their a change with J2SE 1.5 compiler? I don't want to use a generic Exception, because I want to handle the specific exceptions. Any suggestions how to fix? Thanks
    try {
    SendMail(....);
    } catch (MessagingException e1) {
    logger.fine(e1.toString());
    } catch (AddressException e2) {
    logger.fine(e2.toString());
    public String SendMail(....) throws AddressException,
    MessagingException {....                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I found the problem:
    "A catch block handles exceptions that match its exception type (parameter) and exception types that are subclasses of its exception type (parameter). Only the first catch block that handles a particular exception type will execute, so the most specific exception type should come first. You may get a catch is unreachable syntax error if your catch blocks do not follow this order."
    If I switch the order of the catch exceptions the compiler error goes away.
    thanks

  • Getting started help

    Perhaps someone wouldn't mind helping with some simple questions....
    I'd like to get started with Java Server Pages but I am finding the process absolutely bewildering.
    At the moment I have a site running Jrun 3.1 and I use J2SE, so I think I will have my work cut out just to get started, though perhaps someone can enlighten me.
    Jrun 3.1 doesn't even implement Servlet API 2.3 and whenever I hear talk of Java Server Faces I seem to hear J2EE. However I have no great wish to update Jrun with our server running smoothly (touch wood) and changing from J2SE to J2EE seems like yet another big change.
    I had a look at changing to Tomcat, but again why do so when things are running smoothly as they are?
    Ok, so I've been looking at Java Web Services pack, which seems to solve some of the problems and the blurb says:
    "Note that the Java WSDP is an integrated toolkit that you can use to develop and deploy not only Web services, but also Web and XML-based applications".
    But presumably I need a servlet container behind it and Jrun 3.1 is probably too old, is that right?
    Ok, at this point perhaps I could leave my existing applications running happily in Jrun 3.1 and J2SE, install Tomcat and J2EE separately and run any new applications alongside in the new environment. I've got 1GB of memory, and then maybe one day I move over the old applications.
    Perhaps somebody could give me some pointers, given my situation.
    Thanks for your time.

    JavaServer Faces requires an environment that supports at least Servlet 2.3 and JSP 1.2. It will not run on any server that supports Servlet 2.2 or earlier only. Any J2EE 1.3 or later app server meets these criteria, but it's not required (for JavaServer Faces) that you have a full J2EE server unless you need those facilities (such as EJBs) for your applications.
    The Java Web Services Developer Pack includes Tomat 5, or you can use an existing Tomcat installation (must be 4.1 or 5.0). Tomcat is pretty easy to set up (especially if you just use it standalone, and not try to run it behind the Apache HTTPD server).
    Craig MClanahan

  • Which webstart version is starting my app ?? [confused...]

    I'm a bit confused, but maybe someone can help me out.
    This is the situation:
    -> Installed on my Windows machine:
    * JRE 1.5.0 (of JDK, that's the same)
    * also a JRE 1.4.2_07
    * a firewall
    * IE or firefox browser (with mime-type "application/x-javajnlp-file" mapped correctly).
    -> a webapp on some (web)server (also with mime-type correctly configured). The webapp contains the necessary resources (jars, jnlp file).
    -> here's the jnlp file:
    <?xml version="1.0" encoding="utf-8"?>
    <jnlp spec="1.0+" codebase="http://server1/someapp" href="someapp.jnlp">
    <information>
    <title>Some App</title>
    <vendor>Sun Microsystems, Inc.</vendor>
    <offline-allowed/>
    </information>
    <resources>
    <jar href="app1.jar"/>
    <j2se version="1.4.2*" href="http://java.sun.com/products/autodl/j2se"/>
    </resources>
    <application-desc main-class="myapp"/>
    </jnlp>
    -> while starting the app, i notice that, i guess the 1.5 java webstart engine handles this app (it seems to be 1.5 stuff when i look at the layout of the dialog). BUT (!) the only traffic passing my firewall is that of the following application: .../jre1.4.2_07/bin/javaw.exe. So, th� question is: "what "java web start - version" (*) is actually running my code ??
    (*) i'm not talking about the JRE. That should be 1.4.2_07, since i asked, in the jnlp, for my code to run in a 1.4.2* JRE. But there must be some javaws active, f.i. for examining my app jars on the webserver.
    P.S. when i change the <j2se version ...> into 1.5+, the request i intercept then is actually coming from jre1.5.0_05/bin/javaw.exe (which i expected in the first place).
    help.

    Yes - in this case you run webstart 1.5.0 with jre 1.4.7
    the jnlp mime type is setup by the windows installer when installing a jre that is the latest on the system. (it actually points to <windows dir>/system32/javaws.exe, which is set up as the latest version installed)
    /Andy

  • Whats a String constant pool?

    I was reading an article about weak references and came across a peice of code
       Map<String,String> map = new WeakHashMap<String, String>();
          map.put(new String("Scott"), "McNealey");They also said
    if you don't call new String(), the reference for the map key will be to the system's string constant pool. This never goes away, so the weak reference will never be released. To get around this, new String("Scott") creates a reference to the reference in the string constant pool. The string contents are never duplicated. They stay in the constant pool. This simply creates a separate pointer to the string constant in the pool.
    I never heard of String constant pool could any one enlighten me. I didnt get the point of what above paragraph says also.
    Jubs

    No it won't: it will only be removed when the garbage collector rears
    its ugly head. Until then the reference will be present in the map.Okay it was unprecise. The item MAY be removed immediately after it
    has been inserted because the key object is only referenced from the
    Map itself.Yes, that is true, but mind though: any object that still has a strong
    reference to it will not be removed from that map. I use such weak maps
    for localization reasons a lot. When a localization changes (while the
    application is running), a whole lot of visual components must have
    their text part changed. They are all stored in such a weak reference map.
    Of course quite some visual components can be garbage collected
    at some time (think of labels etc. in JDialogs after the dialog has been
    disposed).
    These maps are ideal for those purposes.
    kind regards,
    Jos

  • Draw a path on a image?

    Hi!
    I have a image that is like a "map" of something and i need to draw the localization of a car in that map. That localization changes in time. I want to display that in a swing aplication...
    right now i have the image in a JLabel with ImageIcon. to draw the 'car' (when a button is pressed) i do a getGraphics and I draw a fillRect... Everything ok until I try to remove the old localizationn of the car and i draw the new one...
    I don't know how to clear the old localization. I can't fill it with white, that way i can't see the map image below that... I have to clear it with a transparent Color or something like that, or simply remove that graphics..
    please note that when i click that button i have a for loop, 50 iterations, to show the car "moving" around the map...
    any ideia on how I should do this, or HOW can I do this???
    TIA

    hi,
    i never tried jlayerede pane but i don't know if i will solve the problem with that because in the top layer (the car layer) i will do a fillrect to represent the car... wait some seconds, then clearRect and then draw the new position of the car... I guess the trail of the car will appear in white, no?
    i wil try anyway :)

  • Why we use interfaces ?

    hi all!
    i m confused that what is the advantage of using interfaces for classes if it is for security,data hiding pupose then we can use private modifiers,then y is this think built in java and which r the cases in which we must use interfaces and y?
    plz give me any simple example to understand ur point
    thanx in advance.
    sajjad ahmad

    Hmm... First, I'm sorry about my English... but i will try.
    In C++ we can use multi-inheritance that let the developer "extends" one or more classes.
    eg.
    class Hello extends A,B,C,D
    This case can be happened in C++.
    But If both class A and B have a method call "void sayMyName()"
    How can we refer which method was called when we call "Hello.sayMyName()"
    A.sayMyName() or B.sayMyName()
    So java don't allow this thing happen.
    Java allow developers to extend "only one class"
    but to enable multi-inheritance ability Java allow developer to implement more than one class.
    That is "interface" which was implemented.
    Now lets talk about it's benefits.
    Interface is not for security or data hiding purpose.
    But interface is used for "make a template".
    When I created one class called Hello.
    But I have created another class too.
    Now I want to make sure that my classed have a method "void say()"
    What can I do ?
    1. Make some class that have a method "void say()" and let my classes extend it.
    2. Make an interface and implement it.
    Choise number one is quite good ... but !!!
    If I have to extend some another class that is more important such as "Applet"
    Now I can't extend another class.
    I need only method "void say()". But I don't care what it does.
    So I make an interface that force the implementing class to create a method "void say()"
    and I implement it.
    Question: Why I have to implement this interface ? If I only define a method "void say()"
    The problems is gone ....
    Answer: That may be true if I want them to have a method. But how can I refer to them.
    Lets see this code.
    class A extends Applet {
    void say() {System.out.println("My name is A");}
    ... go on ...
    class B extends Applet {
    void say() {System.out.println("My name is B")}
    ... go on ...
    class GO {
    public void letMeSay(............. o) {
    o.say();
    What can I fill in the argument of method "letMeSay()"?
    Object ? Object doesn't have a method "void say()"
    Applet ? With the same reason.
    Now lets see another code.
    interface Sayable {
    abstract void say();
    class A extends Applet implements Sayable {
    void say() {System.out.println("My name is A");}
    ... go on ...
    class B extends Applet implements Sayable {
    void say() {System.out.println("My name is B")}
    ... go on ...
    public void letMeSay(Sayable o) {
    o.say();
    It's ok right ... I can refer to interface "Sayable" that can "say"
    Next benefit of interface ... "define Constants field"
    We can define constants in an interface and implements it to everywhere we want to use those constants. When we change a value in this interface ... Constants in another place will be changed too .... that is very useful ....(But this may have change in J2SE 1.5 ... see more info)
    "I HOPE THIS REPLY MAY GIVE YOU SOME KNOWLEDGE ... GOOD LUCK WITH PROGRAMMING"

  • What is the Easiest way to sequence records in a Interface?

    I very simply want to add a sequence number in the Mapping definition to an interface as I process records and write to a simple file. I want to start at 1 each time and process to X.
    I would think their should be a reserved word like (rowcount or counter) but for the life of me I can't find it. I would have thought I could have used Variables, but that does not seem on because there does not seem to a way to update them. Looks like a sequence is the only way to go, but then I have to reset it every time and my initial testing indicated it would not increment. But that is probably operator trouble! I would like to know how the experts would accomplish this simply programming feat. ODI is so powerful, why make such a simple thing so complicated?
    Thanks

    First off, make them learn GridBagLayout as well as the other layout managers (like BorderLayout). Have them play around with JBuilder's visual editor, making note of what changes visually do to the underlying code, etc. It will serve them well.
    I have yet to find an "easier" layout manager that doesn't at some point tie your hands and end up making life more difficult. With GridBagLayout, BorderLayout and use of subcontainers, you can do anything you might need. :-)
    I wouldn't say absolute positioning is anti-Java.
    It's certainly more work to deal with in most cases.
    . You can always get the screen resolution and
    adjust your sizes accordingly. It's still 100% pure
    Java code. It is anti in that it doesn't follow the general spirit of Java. Yes it will be 100% Java code, but it will be at least 90% crap as well. :-) You then can't easily do localization, changes in the look & feel mess up your app, your components won't resize properly, any change to a label's text causes you to have to tweak everything, etc. Ghastly stuff. It is the lazy way to get the GUI to look like someones mock up, but that is all it's good for.
    If you run across a GUI done with absolute positioning, you have my permission to give the responsible developer an atomic wedgie.

Maybe you are looking for

  • Firefox wont open, it keeps coming up with the crash report, i've eve restarted the computer, it still isnt working?

    I was just checking my facebook when firefox unexpectedly stopped, then closed down. i clicked back on it and it came up with the crash report. i clicked restart firefox so many times yet it kept coming up with crash report again. i did quit then tri

  • Is there a way to combine layers into precomp AND trim them

    Hi.  I have a bunch of image sequences that I bring in from a 3D program.  Each sequence may have a separate set of images for Shadow, Specular color, Ambient Color, Glow etc - so clip A could have several layers, each with identical length.  The sam

  • How do I make an iPad sandwich?

    Multiple iPads Connected to Each Other? Hey, My main question was if it would be possible for me to connect my two iPads to each other? The main thing i wanted to do was connect them and have them be like a 2 ipad laptop, using one as a keyboard for

  • Error in the Integration Directory

    Hi All, In ID When I Go for Environment-->>Cache Notifications I Got the Following Error <b>Unable to determine the name of the central Adapter Engine from the System Landscape Directory at this time. Notifications to the central Adapter Engine are t

  • How do I learn how the sidebar works in Mail?

    I have added 5 accounts but I can't make sense of why certain things are in certain areas. For example, what's the difference between Mailboxes and On My Mac? I was excited to move towards managing all my email in one place. I have numerous questions