Global KeyListener in JFrame with JDK 1.4

Hi!
I need to get some keyboard events in my JFrame or JDialog, no matter what subcomponent currently has the focus. I use this for example to display a help screen when the user hits F1.
In JDK 1.3 I wrote in my constructor:
this.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(KeyEvent e) {
this_keyPressed(e);
and then had a method
void this_keyPressed(KeyEvent e) { ... }
handling those events.
In JDK 1.4 this code only works, if I call this.requestFocus(), but since the user should be able to TAB through the frame and hit F1 in every textfield, button etc., this is no solution --- as soon as "this" loses the focus, it won't work any more.
I also tried using Key Bindings, but somehow I couldn't get it working.
I need a solution for this problem that works with 1.3 as well as with 1.4!! Do you have any ideas of how to do this?
Thanks for your help!!
Nicolas Michael <[email protected]>

looking at the source for Choice its not doing a great deal in add():
pItems is a vector, so I guess if there is anything that could be slow its the native call, but again this seems unlikely?
btw, if ur adding to the Choice box when its visible it will be a lot slower - is it possible to initialise before the applet is displayed?
asjf
ps. note the demo code above is adding numbers as strings, but I agree this shouldn't make any difference
//from java/awt/Choice.java (same from 1.2.1 to 1.4.1 - have not checked 1.1)
public void add(String item) {
   addItem(item);
public void addItem(String item) {
   synchronized (this) {
      addItemNoInvalidate(item);
   if (valid)
   invalidate();
private void addItemNoInvalidate(String item) {
   if (item == null) {
      throw new
      NullPointerException("cannot add null item to Choice");
   pItems.addElement(item);
   ChoicePeer peer = (ChoicePeer)this.peer;
   if (peer != null) {
      peer.addItem(item, pItems.size() - 1);
   if (selectedIndex < 0) {
      select(0);
}

Similar Messages

  • BC4J temporary focus problem with JDK 1.4.2

    Hello all,
    we have got a tricky problem with BC4J (Oracle JDeveloper 9.0.3.2)
    using the JDK 1.4.2 (Sun):
    There is a JFrame with a JMenuBar, containing a BC4J data panel with the controls on it.
    Now if one enters a value in a control and now directy clicks on the JMenuBar, the control
    gets a focusLost event but is not validated through BC4J and not set to the model.
    If a commit would be called from the menue the entered data is lost !
    In case of the JDK 1.3.1_02, which comes with the JDeveloper, everything works fine: after
    the focusLost event, the data is validated and set to the model.
    We have investigated the problem more deeper. The difference between
    the 1.4 and 1.3 is, that the 1.4 creates a temporary FocusEvent and the 1.3 not.
    We stepped up the stack into the Method oracle.jbo.uicli.jui.JUSVUpdateableFocusAdapter.focusLost:
    the temporary focusEvent causes this method to return and to do nothing:
    * Performs a setAttribute() on the control binding to save the changes made by
    * the control to the attribute value.
    public void focusLost(FocusEvent e)
    if (e.isTemporary())
    return;
    JUCtrlAttrsBinding binding = (JUCtrlAttrsBinding)mAttrBinding;
    I think it is a general problem with 1.4, because many things dealing with focus
    have been expaned and changed.
    Is this a bug or should BC4J not be used with 1.4 ?
    Greetings

    9.0.3.2 is not tested with JDK 1.4, so issues like this are not a surprise.
    However we will test this with our current development branch (which is being tested on JDK 1.4x) and verify if the behavior is reproducible.

  • Error while running Dev60 with jdk 11711o

    Dear OTN Members / Oracle Development Team.
    Have any one tried it. Help required form Oracle Devlopemnt
    Team.
    hi i am using oracle8 OAS 4.0.7, Developer 6.0 production
    with NT 4.0 and service Pack 3
    when i try to run the form through jinitinator or JDK provided
    with the package i get the following error.
    running with jinitator
    Oracle JInitiator version 1.1.7.11
    Using JRE version 1.1.7.11o
    User home directory = E:\WINNT\Profiles\Administrator
    Proxy Configuration: no proxy
    java.io.FileNotFoundException: \forms60\f60all.jar
    at java.io.FileInputStream.<init>(FileInputStream.java:56)
    at sun.net.www.protocol.file.FileURLConnection.connect(Compiled
    Code)
    at
    sun.net.www.protocol.file.FileURLConnection.getInputStream(FileUR
    LConnection.java:162)
    at
    sun.net.www.protocol.http.HttpURLConnection.openConnectionCheckRe
    directs(Compiled Code)
    at
    sun.applet.AppletCache.getInputStream(AppletCache.java:588)
    at
    sun.applet.AppletResourceLoader.loadJar(AppletResourceLoader.java
    171)
    at sun.applet.JinitAppletPanel.loadJarFiles(Compiled
    Code)
    at sun.plugin.AppletViewer.loadJarFiles(Compiled Code)
    at
    sun.applet.JinitAppletPanel.runLoader(JinitAppletPanel.java:500)
    at sun.applet.JinitAppletPanel.run(Compiled Code)
    at java.lang.Thread.run(Thread.java:466)
    and with JDK
    Microsoft (R) VM for Java, 5.0 Release 5.0.0.3165
    ==============================================
    ? help
    c clear
    f run finalizers
    g garbage collect
    m memory usage
    q quit
    t thread list
    ==============================================
    com.ms.security.SecurityExceptionEx[oracle/forms/engine/Main.init
    ]: cannot access file E:\WINNT\Java\.hotjava
    at com/ms/security/permissions/FileIOPermission.check
    at com/ms/security/PolicyEngine.deepCheck
    at com/ms/security/PolicyEngine.checkPermission
    at com/ms/security/StandardSecurityManager.chk
    at com/ms/security/StandardSecurityManager.checkRead
    at java/io/File.exists
    at java/io/File.mkdirs
    at sun/applet/AppletViewer.<clinit>
    at java/lang/ClassLoader.findSystemClass
    at com/ms/vm/loader/URLClassLoader.loadClass
    at java/lang/ClassLoader.loadClassInternal
    at oracle/forms/engine/Main.init
    at com/ms/applet/AppletPanel.securedCall0
    at com/ms/applet/AppletPanel.securedCall
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    Error getting package information: sun/applet
    com.ms.packagemanager.PackageManagerException: Package not
    ound
    at com/ms/packagemanager/PackageManager.getPackage
    at
    com/ms/security/SecurityClassLoader.getSecurityInfoFromPackage
    at
    com/ms/security/SecurityClassLoader.findPackageManagerClass
    at
    com/ms/security/SecurityClassLoader.findPackageManagerClass
    at com/ms/vm/loader/URLClassLoader.loadClass
    at java/lang/ClassLoader.loadClassInternal
    at oracle/forms/engine/Main.init
    at com/ms/applet/AppletPanel.securedCall0
    at com/ms/applet/AppletPanel.securedCall
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    java.lang.ClassNotFoundException: sun.applet.AppletViewer
    at com/ms/vm/loader/URLClassLoader.loadClass
    at java/lang/ClassLoader.loadClassInternal
    at oracle/forms/engine/Main.init
    at com/ms/applet/AppletPanel.securedCall0
    at com/ms/applet/AppletPanel.securedCall
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    what could be the problem have any one encountered this kind of
    problem.
    pls help required.
    mobeen
    null

    Dear OTN Members / Oracle Development Team.
    Have any one tried it. Help required form Oracle Devlopemnt
    Team.
    hi i am using oracle8 OAS 4.0.7, Developer 6.0 production
    with NT 4.0 and service Pack 3
    when i try to run the form through jinitinator or JDK provided
    with the package i get the following error.
    running with jinitator
    Oracle JInitiator version 1.1.7.11
    Using JRE version 1.1.7.11o
    User home directory = E:\WINNT\Profiles\Administrator
    Proxy Configuration: no proxy
    java.io.FileNotFoundException: \forms60\f60all.jar
    at java.io.FileInputStream.<init>(FileInputStream.java:56)
    at sun.net.www.protocol.file.FileURLConnection.connect(Compiled
    Code)
    at
    sun.net.www.protocol.file.FileURLConnection.getInputStream(FileUR
    LConnection.java:162)
    at
    sun.net.www.protocol.http.HttpURLConnection.openConnectionCheckRe
    directs(Compiled Code)
    at
    sun.applet.AppletCache.getInputStream(AppletCache.java:588)
    at
    sun.applet.AppletResourceLoader.loadJar(AppletResourceLoader.java
    171)
    at sun.applet.JinitAppletPanel.loadJarFiles(Compiled
    Code)
    at sun.plugin.AppletViewer.loadJarFiles(Compiled Code)
    at
    sun.applet.JinitAppletPanel.runLoader(JinitAppletPanel.java:500)
    at sun.applet.JinitAppletPanel.run(Compiled Code)
    at java.lang.Thread.run(Thread.java:466)
    and with JDK
    Microsoft (R) VM for Java, 5.0 Release 5.0.0.3165
    ==============================================
    ? help
    c clear
    f run finalizers
    g garbage collect
    m memory usage
    q quit
    t thread list
    ==============================================
    com.ms.security.SecurityExceptionEx[oracle/forms/engine/Main.init
    ]: cannot access file E:\WINNT\Java\.hotjava
    at com/ms/security/permissions/FileIOPermission.check
    at com/ms/security/PolicyEngine.deepCheck
    at com/ms/security/PolicyEngine.checkPermission
    at com/ms/security/StandardSecurityManager.chk
    at com/ms/security/StandardSecurityManager.checkRead
    at java/io/File.exists
    at java/io/File.mkdirs
    at sun/applet/AppletViewer.<clinit>
    at java/lang/ClassLoader.findSystemClass
    at com/ms/vm/loader/URLClassLoader.loadClass
    at java/lang/ClassLoader.loadClassInternal
    at oracle/forms/engine/Main.init
    at com/ms/applet/AppletPanel.securedCall0
    at com/ms/applet/AppletPanel.securedCall
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    Error getting package information: sun/applet
    com.ms.packagemanager.PackageManagerException: Package not
    ound
    at com/ms/packagemanager/PackageManager.getPackage
    at
    com/ms/security/SecurityClassLoader.getSecurityInfoFromPackage
    at
    com/ms/security/SecurityClassLoader.findPackageManagerClass
    at
    com/ms/security/SecurityClassLoader.findPackageManagerClass
    at com/ms/vm/loader/URLClassLoader.loadClass
    at java/lang/ClassLoader.loadClassInternal
    at oracle/forms/engine/Main.init
    at com/ms/applet/AppletPanel.securedCall0
    at com/ms/applet/AppletPanel.securedCall
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    java.lang.ClassNotFoundException: sun.applet.AppletViewer
    at com/ms/vm/loader/URLClassLoader.loadClass
    at java/lang/ClassLoader.loadClassInternal
    at oracle/forms/engine/Main.init
    at com/ms/applet/AppletPanel.securedCall0
    at com/ms/applet/AppletPanel.securedCall
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    what could be the problem have any one encountered this kind of
    problem.
    pls help required.
    mobeen
    null

  • A problem regarding set up of Oracle Lite 3.6.0.2.0 on Win 95, with JDK 1.1.8 &java 2

    A problem regarding set up of Oracle Lite 3.6.0.2.0 on Win 95, with JDK 1.1.8 and Java 2 SDK ( Ver 1.3 Beta)
    After the installation of Oracle Lite 3.6.0.2.0 on a laptop (with WIN 95 OS), When I run Oracle Lite Designer from start menu, I receive following error message :
    ====================================
    Invalid class name 'FILES\ORA95_2\LITE\DESIGNER\oldes.jar;C:\PROGRAM'
    usage: java [-options] class
    where options include:
    -help print out this message
    -version print out the build version
    -v -verbose turn on verbose mode
    -debug enable remote JAVA debugging
    -noasyncgc don't allow asynchronous garbage collection
    -verbosegc print a message when garbage collection occurs
    -noclassgc disable class garbage collection
    -ss<number> set the maximum native stack size for any thread
    -oss<number> set the maximum Java stack size for any thread
    -ms<number> set the initial Java heap size
    -mx<number> set the maximum Java heap size
    -classpath <directories separated by semicolons>
    list directories in which to look for classes
    -prof[:<file>] output profiling data to .\java.prof or .\<file>
    -verify verify all classes when read in
    -verifyremote verify classes read in over the network [default]
    -noverify do not verify any class
    -nojit disable JIT compiler
    Please make sure that JDK 1.1.4 (or greater) is installed in your machine and CLASSPATH is set properly. JAVA.EXE must be in the PATH.
    ====================================
    My ORACLE_HOME is c:\program files\ora95_2 and Oracle Lite is installed under the ORACLE_HOME in LITE\DESIGNER directory.
    JDK version is 1.1.8 which is greater than 1.1.4 installed in c:\program files\jdk1.1.8, My PATH, and CLASSPATH are set in AUTOEXEC.BAT as follows:
    set CLASSPATH=c:\Progra~1\jdk1.1.8\lib\classes.zip;c:\progra~1\ora95_2\lite\classes\olite36.jar;c:\progra~1\ora95_2\lite\designer\oldes.jar;c:\progra~1\ora95_2\lite\designer\swingall.j ar
    PATH=C:\Progra~1\Ora95_2\bin;.;c:\Progra~1\jdk1.1.8\lib;c:\Progra~1\jdk1.1.8\bin;C:\Progra~1\Ora95_2\lite\Designer;C:\WIN95;C:\WIN95\COMMAND;C:\UTIL
    And, I can run JAVA.EXE from any directory on command prompt.
    With JAVA 2 SDK (ver 1.3 Beta) instead of JDK 1.1.8 I'm getting a different Error message as follows:
    =============================
    java.lang.NoClassFoundError: 'FILES\ORA95_2\LITE\DESIGNER\oldes.jar;C:\PROGRAM'
    Please make sure that JDK 1.1.4 (or greater) is installed in your machine and CLASSPATH is set properly. JAVA.EXE must be in the PATH.
    ==============================
    the PATH and CLASSPATH were set accordingly, as with JDK1.1.8, and there was no classes.zip in classpath
    also the class file or the jar file looks weird or wrapped in the error message : 'FILES\ORA95_2\LITE\DESIGNER\oldes.jar;C:\PROGRAM'
    Another interesting thing I noticed is if I run oldes.exe from Installation CD, the Oracle Lite Designer runs fine, and without error, I'm able to modify tables in the database of my laptop also.
    Could someone shade some light on what am I doing wrong here ?
    Thanks for help in advance .
    Regards
    Viral
    null

    On 07/20/2015 06:35 AM, Itzhak Hovav wrote:
    > hi
    > [snip]
    > [root@p22 eclipse]# cat eclipse.ini -startup
    > plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
    > --launcher.library
    > plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120913-144807
    >
    > -showsplash
    > org.eclipse.platform
    > --launcher.XXMaxPermSize
    > 256m
    > --launcher.defaultAction
    > openFile
    > -vmargs
    > -Xms40m
    > -Xmx512m
    > [snip]
    Try this: http://wiki.eclipse.org/Eclipse.ini. You should have read the
    sticky posts at forum's top for getting started help.

  • Performance problems with jdk 1.5 on Linux plattform

    Performance problems with jdk 1.5 on Linux plattform
    (not tested on Windows, might be the same)
    After refactoring using the new features from java 1.5 I lost
    performance significantly:
    public Vector<unit> units;
    The new code:
    for (unit u: units) u.accumulate();
    runs more than 30% slower than the old code:
    for (int i = 0; i < units.size(); i++) units.elementAt(i).accumulate();
    I expected the opposite.
    Is there any information available that helps?

    Here's the complete benchmark code I used:package test;
    import java.text.NumberFormat;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.LinkedList;
    import java.util.Vector;
    public class IterationPerformanceTest {
         private int m_size;
         public IterationPerformanceTest(int size) {
              m_size = size;
         public long getArrayForLoopDuration() {
              Integer[] testArray = new Integer[m_size];
              for (int item = 0; item < m_size; item++) {
                   testArray[item] = new Integer(item);
              StringBuilder builder = new StringBuilder();
              long start = System.nanoTime();
              for (int index = 0; index < m_size; index++) {
                   builder.append(testArray[index]);
              long end = System.nanoTime();
              System.out.println(builder.length());
              return end - start;
         public long getArrayForEachDuration() {
              Integer[] testArray = new Integer[m_size];
              for (int item = 0; item < m_size; item++) {
                   testArray[item] = new Integer(item);
              StringBuilder builder = new StringBuilder();
              long start = System.nanoTime();
              for (Integer item : testArray) {
                   builder.append(item);
              long end = System.nanoTime();
              System.out.println(builder.length());
              return end - start;
         public long getArrayListForLoopDuration() {
              ArrayList<Integer> testList = new ArrayList<Integer>();
              for (int item = 0; item < m_size; item++) {
                   testList.add(item);
              StringBuilder builder = new StringBuilder();
              long start = System.nanoTime();
              for (int index = 0; index < m_size; index++) {
                   builder.append(testList.get(index));
              long end = System.nanoTime();
              System.out.println(builder.length());
              return end - start;
         public long getArrayListForEachDuration() {
              ArrayList<Integer> testList = new ArrayList<Integer>();
              for (int item = 0; item < m_size; item++) {
                   testList.add(item);
              StringBuilder builder = new StringBuilder();
              long start = System.nanoTime();
              for (Integer item : testList) {
                   builder.append(item);
              long end = System.nanoTime();
              System.out.println(builder.length());
              return end - start;
         public long getArrayListIteratorDuration() {
              ArrayList<Integer> testList = new ArrayList<Integer>();
              for (int item = 0; item < m_size; item++) {
                   testList.add(item);
              StringBuilder builder = new StringBuilder();
              long start = System.nanoTime();
              Iterator<Integer> iterator = testList.iterator();
              while(iterator.hasNext()) {
                   builder.append(iterator.next());
              long end = System.nanoTime();
              System.out.println(builder.length());
              return end - start;
         public long getLinkedListForLoopDuration() {
              LinkedList<Integer> testList = new LinkedList<Integer>();
              for (int item = 0; item < m_size; item++) {
                   testList.add(item);
              StringBuilder builder = new StringBuilder();
              long start = System.nanoTime();
              for (int index = 0; index < m_size; index++) {
                   builder.append(testList.get(index));
              long end = System.nanoTime();
              System.out.println(builder.length());
              return end - start;
         public long getLinkedListForEachDuration() {
              LinkedList<Integer> testList = new LinkedList<Integer>();
              for (int item = 0; item < m_size; item++) {
                   testList.add(item);
              StringBuilder builder = new StringBuilder();
              long start = System.nanoTime();
              for (Integer item : testList) {
                   builder.append(item);
              long end = System.nanoTime();
              System.out.println(builder.length());
              return end - start;
         public long getLinkedListIteratorDuration() {
              LinkedList<Integer> testList = new LinkedList<Integer>();
              for (int item = 0; item < m_size; item++) {
                   testList.add(item);
              StringBuilder builder = new StringBuilder();
              long start = System.nanoTime();
              Iterator<Integer> iterator = testList.iterator();
              while(iterator.hasNext()) {
                   builder.append(iterator.next());
              long end = System.nanoTime();
              System.out.println(builder.length());
              return end - start;
         public long getVectorForLoopDuration() {
              Vector<Integer> testVector = new Vector<Integer>();
              for (int item = 0; item < m_size; item++) {
                   testVector.add(item);
              StringBuilder builder = new StringBuilder();
              long start = System.nanoTime();
              for (int index = 0; index < m_size; index++) {
                   builder.append(testVector.get(index));
              long end = System.nanoTime();
              System.out.println(builder.length());
              return end - start;
         public long getVectorForEachDuration() {
              Vector<Integer> testVector = new Vector<Integer>();
              for (int item = 0; item < m_size; item++) {
                   testVector.add(item);
              StringBuilder builder = new StringBuilder();
              long start = System.nanoTime();
              for (Integer item : testVector) {
                   builder.append(item);
              long end = System.nanoTime();
              System.out.println(builder.length());
              return end - start;
         public long getVectorIteratorDuration() {
              Vector<Integer> testVector = new Vector<Integer>();
              for (int item = 0; item < m_size; item++) {
                   testVector.add(item);
              StringBuilder builder = new StringBuilder();
              long start = System.nanoTime();
              Iterator<Integer> iterator = testVector.iterator();
              while(iterator.hasNext()) {
                   builder.append(iterator.next());
              long end = System.nanoTime();
              System.out.println(builder.length());
              return end - start;
          * @param args
         public static void main(String[] args) {
              IterationPerformanceTest test = new IterationPerformanceTest(1000000);
              System.out.println("\n\nRESULTS:");
              long arrayForLoop = test.getArrayForLoopDuration();
              long arrayForEach = test.getArrayForEachDuration();
              long arrayListForLoop = test.getArrayListForLoopDuration();
              long arrayListForEach = test.getArrayListForEachDuration();
              long arrayListIterator = test.getArrayListIteratorDuration();
    //          long linkedListForLoop = test.getLinkedListForLoopDuration();
              long linkedListForEach = test.getLinkedListForEachDuration();
              long linkedListIterator = test.getLinkedListIteratorDuration();
              long vectorForLoop = test.getVectorForLoopDuration();
              long vectorForEach = test.getVectorForEachDuration();
              long vectorIterator = test.getVectorIteratorDuration();
              System.out.println("Array      for-loop: " + getPercentage(arrayForLoop, arrayForLoop) + "% ("+getDuration(arrayForLoop)+" sec)");
              System.out.println("Array      for-each: " + getPercentage(arrayForLoop, arrayForEach) + "% ("+getDuration(arrayForEach)+" sec)");
              System.out.println("ArrayList  for-loop: " + getPercentage(arrayForLoop, arrayListForLoop) + "% ("+getDuration(arrayListForLoop)+" sec)");
              System.out.println("ArrayList  for-each: " + getPercentage(arrayForLoop, arrayListForEach) + "% ("+getDuration(arrayListForEach)+" sec)");
              System.out.println("ArrayList  iterator: " + getPercentage(arrayForLoop, arrayListIterator) + "% ("+getDuration(arrayListIterator)+" sec)");
    //          System.out.println("LinkedList for-loop: " + getPercentage(arrayForLoop, linkedListForLoop) + "% ("+getDuration(linkedListForLoop)+" sec)");
              System.out.println("LinkedList for-each: " + getPercentage(arrayForLoop, linkedListForEach) + "% ("+getDuration(linkedListForEach)+" sec)");
              System.out.println("LinkedList iterator: " + getPercentage(arrayForLoop, linkedListIterator) + "% ("+getDuration(linkedListIterator)+" sec)");
              System.out.println("Vector     for-loop: " + getPercentage(arrayForLoop, vectorForLoop) + "% ("+getDuration(vectorForLoop)+" sec)");
              System.out.println("Vector     for-each: " + getPercentage(arrayForLoop, vectorForEach) + "% ("+getDuration(vectorForEach)+" sec)");
              System.out.println("Vector     iterator: " + getPercentage(arrayForLoop, vectorIterator) + "% ("+getDuration(vectorIterator)+" sec)");
         private static NumberFormat percentageFormat = NumberFormat.getInstance();
         static {
              percentageFormat.setMinimumIntegerDigits(3);
              percentageFormat.setMaximumIntegerDigits(3);
              percentageFormat.setMinimumFractionDigits(2);
              percentageFormat.setMaximumFractionDigits(2);
         private static String getPercentage(long base, long value) {
              double result = (double) value / (double) base;
              return percentageFormat.format(result * 100.0);
         private static NumberFormat durationFormat = NumberFormat.getInstance();
         static {
              durationFormat.setMinimumIntegerDigits(1);
              durationFormat.setMaximumIntegerDigits(1);
              durationFormat.setMinimumFractionDigits(4);
              durationFormat.setMaximumFractionDigits(4);
         private static String getDuration(long nanos) {
              double result = (double)nanos / (double)1000000000;
              return durationFormat.format(result);
    }

  • Is it possible to run OAS 10.1.2  with JDK 1.6 ???

    Well on the one hand we have Oracle ADF BC application that was developed with JDeveloper 10.3.4 and runs fine on OAS 10.1.2 JDK 1.4 on the other hand we have a 3rd party Map Server (servlet + java code) that is black box and only runs on JDK 1.6 because it needs JDK 1.6 features.
    Currently the only available course of going forward is to introduce a new open source 1.6 compliant server to run the Map Server and use AJAX to cross domain communicate the two. Client would like to avoid this, would like one application on one server.
    Restrictions are
    1) To get the Map Server in JDK 1.4 format is not an option and
    2) Upgrading to a Oracle Server that is JDK 1.6 and supports the ADF BC application is not an option. And not sure if OAS 11 can run the ADF BC application since I did a quick test by trying to compile the ADF BC application JDeveloper 10.3.4 code in JDeveloper 11 with out any success.
    So to my question if I could run OAS 10.1.2 JDK 1.6 it might solve the problem before i attempt that I like to ask the ideas of others that might have faced such integration issues before.
    This is urgent any help is welcome by anyone and everyone and especially the Gurus.
    thanks in advanced health and happiness to every one

    AFAIK, Oracle AS 10.1.2 is not certified with JDK 1.5 or higher.
    Oracle AS 10.1.3 is certified with JDK 1.5 and 1.6 on some platforms. (Check metalink.oracle.com -> certify for details)
    Oracle FMW 11.1.1.0.1 (aka WebLogic 10.3 plus JDeveloper 11.1.1.0.1) is certified with JDK 1.6
    Not certified means use it on your own risk - no support.
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Issue while installing ODI 11.1.1.6 with JDK 7u

    Hi All,
    I am working on installing ODI on windows 64 bit. I downloaded lastest web logic server files, ODI files and JDK files from oracle site..
    I installed Web Logice server with no errors but when I tried to install ODI by running the setup.exe it was giving me an error:
    "Error: Provide the JDK/JRE Location while launching the installer. Invoke the sertup.exe with -jreLoc <JDK/JRE Location absolute path>Parameter(s)".
    So, I looked in to JDK file and noticed that it is an old file and need to be updated so I installed "jdk-7uf-windows-i586.exe". After installing when I try to setup ODI, I am still getting the same error..
    It is asking me to provide the location but I am not srue where to provide the location.. I know the location for JDK i.e. C:\Program files\Java\jdk1.7.0_04 but I am not sure where to provide this location for ODI..
    Thanks a lot!

    2 things must be noticed:
    First: ODI 11g is not supported by JDK 7, I always use the JDK1.6.0_27 and works fine. When you try to open the ODI Studio, this message appears, telling that ODI is supported only with JDK 6 versions, so don't try to use JDK 7.
    Second: I always install the JDK in a path without spaces, like "C:\JDK1.6.0_27\" and the excatly same thing to odi install files. So I call via Command Prompt:
    C:\ODI_INSTALL\Disk1\setup.exe -jreLoc C:\JDK1.6.0_27\
    I did over 20 windows installations using these settings, it'll work perfectly.
    Regards.
    Luiz Araujo

  • Why Oracle 8i is not Working with JDK 1.3

    Why Oracle 8i is not Working with JDK 1.3 by using JDBC.

    try this
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:"somedsn","scott","tiger");
    I am using this for Oracle, it is working for me.
    Uma
    Java Developer
    http://www.globalleafs.com

  • 9.0.4 compatibility with jdk 1.5

    Hi,
    Please do let me know if Oracle AS version 9.0.4.1 is compatible with jdk 1.5.
    What is the jdk version compatible with 9.0.4.1?
    Found the following in the Metalink -> Certify
    In general, Oracle Application Server 10g (9.0.4, 10.1.2.x and 10.1.3.x) support using JDK
    extensions higher than one the product originally shipped with. On 9.0.4, it is possible to move from JDK 1.3.1_06 to extension JDK 1.3.1_07 or beyond.
    Does this imply that 9.0.4 is certified with JDK 1.5?????
    Thanks in advance.
    Regards,
    Sindhiya V.

    desuported? Can you post a source for this?
    9.0.4 is not certified with JDK 1.5 and will not be. AS 10.1.3 is the first release that is (as far as I know).

  • XSLT with java extensions not working with jdk 1.6

    Hi,
    in as XSL transformation I'm using java functions in some cases. With jdk1.5 this works fine. But when switching to jdk1.6 it seems the java classes are not properly initialized.
    See following simple XSL:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java">
         <xsl:output method="html" indent="yes" encoding="iso-8859-1"/>
         <xsl:template match="/">
         <xsl:variable name="counter" select="java:java.util.Vector.new()"/>
         <xsl:variable name="temp1" select="java:add($counter,'1')"/>
         <xsl:variable name="temp2" select="java:add($counter,'2')"/>
         <xsl:variable name="temp3" select="java:add($counter,'3')"/>
         <xsl:value-of select="java:size($counter)"/>
         <xsl:value-of select="java:toString($counter)"/>
         </xsl:template>
    </xsl:stylesheet>
    With jdk 1.5 it creates following output:
    3
    [1, 2, 3]
    With jdk 1.6 I get:
    0
    So I can access the object in jdk 1.6 but adding doesn't work.
    Anybody has an idea what could be wrong or how to fix this?

    thanx this is the solution. With this construct
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java">
         <xsl:output method="html" indent="yes" encoding="iso-8859-1"/>
         <xsl:template match="/">
         <xsl:variable name="counter" select="java:java.util.Vector.new()"/>
         <xsl:variable name="temp1" select="java:add($counter,'1')"/>
         <xsl:variable name="temp2" select="java:add($counter,'2')"/>
         <xsl:variable name="temp3" select="java:add($counter,'3')"/>
         <xsl:variable name="temp4" select="$temp3"/>
         <xsl:value-of select="java:size($counter)"/>
         <xsl:value-of select="java:toString($counter)"/>
         </xsl:template>
    </xsl:stylesheet>
    at least the '3' is added to the vector.

  • Version compatibility  of 10G Application Server 10.1.2.0.2  with  JDK 1.5.

    hi buddies,
    I want to know that whether
    10G Application Server 10.1.2.0.2 with JDK 1.5. is Version compatibility
    pls do send ur replies if known to you.

    Hi ,
    As far as I know AS 10.1.2.0.2 is Not certified with JDK 1.5.
    Please see below some links where you can double-check this
    1. OC4J with JDK 1.5 JSP compilation error
    2. http://docs.huihoo.com/oracle/docs/B14099_19/web.1012/b14011/chap1.htm
    "Only the JDK 1.3.1 and JDK 1.4 compilers are supported and certified by OC4J. It is possible to specify an alternative compiler by adding a <java-compiler> element to the server.xml file, and this might provide a workaround for the "classes not in packages" issue, but no other compilers are certified or supported by Oracle for use with OC4J."
    3. "Certified JDKs" from
    http://www.oracle.com/technology/software/products/ias/files/as_certification_r2_101202.html
    BR,
    Mihai

  • 10G Application Server 10.1.2.0.2 with JDK 1.5.0_16 is Version compatible

    hi buddies,
    I want to know that whether
    10G Application Server 10.1.2.0.2 with JDK 1.5.0_16 is Version compatible
    pls do send ur replies if known to you.

    Hi ,
    As far as I know AS 10.1.2.0.2 is Not certified with JDK 1.5.
    Please see below some links where you can double-check this
    1. OC4J with JDK 1.5 JSP compilation error
    2. http://docs.huihoo.com/oracle/docs/B14099_19/web.1012/b14011/chap1.htm
    "Only the JDK 1.3.1 and JDK 1.4 compilers are supported and certified by OC4J. It is possible to specify an alternative compiler by adding a <java-compiler> element to the server.xml file, and this might provide a workaround for the "classes not in packages" issue, but no other compilers are certified or supported by Oracle for use with OC4J."
    3. "Certified JDKs" from
    http://www.oracle.com/technology/software/products/ias/files/as_certification_r2_101202.html
    BR,
    Mihai

  • Problem in using sybase drivers with JDK 1.5

    hi all,
    i have an app that is connecting to a sybase database.
    so far i have run it using jdk 1.4 using sybase jconn2.jar , it has workedf ine.
    Now, i haven't changed the code, i just recompiled it and re-run it using jdk 1.5 , and suddenly i am getting a classNotFoundException
    java.lang.ClassNotFoundException: com.sybase.jdbc2.jdbc.SybDriver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at BNPParibas.Collateral.SQL.SQLConnectionFactory.DoConnection(SQLConnec
    tionFactory.java:65)
    at BNPParibas.Collateral.SQL.SQLConnectionFactory.Connect(SQLConnectionF
    actory.java:29)
    at BNPParibas.Collateral.SQL.ResultSetFactory.<init>(ResultSetFactory.ja
    va:27)
    at BNPParibas.Collateral.Batch.Flow.FlowControl.load(FlowControl.java:81
    at BNPParibas.Collateral.Batch.Flow.FlowControl.<init>(FlowControl.java:
    62)
    at BNPParibas.Collateral.Batch.Flow.FlowControl.main(FlowControl.java:37
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Appe
    nder
    at BNPParibas.Collateral.Batch.Flow.FlowControl.load(FlowControl.java:16
    8)
    at BNPParibas.Collateral.Batch.Flow.FlowControl.<init>(FlowControl.java:
    62)
    at BNPParibas.Collateral.Batch.Flow.FlowControl.main(FlowControl.java:37
    and NOTHING has changed except that now i am runnign java 1.5 instead of 1.4
    has anyone ever experienced a similar problem?
    regards
    marco

    Hello,
    well, yes it is.
    Running the code with jdk 1.4 is absolutely fine.
    if i run it like this
    <myjdk14install>\bin\java -jar xxx.jar works fine
    if i run it l ike this (which will use 1.5 by default)
    java -jar xxx.jar it gives me that exception...
    have the classloading mechanism changed between jdk 1.4 and jdk 1.5?
    regards
    marco

  • Java 6u24 won't launch signed JNLP app with classes compiled with JDK 1.4.2

    Anyone else having a problem launching a JNLP app compiled with Java 1.4 using Java 6u24 on the client? Anyone have a Java 1.4-compiled app that does launch with Java 6u24?
    I am, and I have isolated the problem to some change in 6u24's java web start launching logic. The splash screen appears and then javaws just quits with no error. Trace shows it is not getting past checking of the first .jar. My JNLP app, fully signed with CA-issued certificate, when compiled with Java 1.4.2 will not launch on JRE 6u24 (or 6u25-b03). The same exact app launches perfectly fine when it is compiled with JDK 1.5 or 1.6. It is not a signing problem, though it is related to certificate checking logic or a concurrency flaw in javaws' AppPolicy and TrustDecider classes. It is not a host server or network problem as those have been varied with same results. It is not a specific .jar problem as I have varied what is the first .jar with same results. I have eliminated all other variables to find the only difference is what Java version the app is compiled with. Well, all but one other variable - I have not tried with apps other than mine.
    My app is compiled with JDK 1.4.2 so I can still support older platforms. That requirement is going away soon but this is still a regression from 6u23 that is causing a big problem for at least this developer.

    You can try to use the version of the jarsigner JDK 1.5 or later.
    Has changed the management of files in META-INF.
    So compile with 1.4 but sign with 1.5 or later

  • How do I replace one JPanel on a JFrame with another?

    I want to replace one JPanel on a JFrame with a different JPanel when the user clicks on a certain menu item. The menu item is working corrrectly but I cant seem to repaint / refresh the component.
    My code is as follows:
    c.add(knotPanel, BorderLayout.CENTER);
    c.add(stepPanel, BorderLayout.NORTH);
         if (stepChoice != 9) {
         c.remove(ownPanel);
         c.add(lessonPanel, BorderLayout.EAST);
         else {
         c.remove(lessonPanel);
         c.add(ownPanel, BorderLayout.EAST);
         c.invalidate();
         c.validate();
         c.update(c.getGraphics());
    Any ideas?

    I think you should use CardLayout manager.
    With CardLayout you can switch beetwen JPanels without removing or adding.

Maybe you are looking for

  • Ipod touch not recognized in itunes windows

    Windows will not recognize my ipod touch. I have gone throught the Apple troubleshooting procedures and no luck.

  • Help Needed with Airport Express

    Hi All, I have recently purchased a new Airport Express with AirTunes and installed the Airport Setup on my laptop as provided on the CD. I am using the Windows Wireless Zero Configuration service to connect to the wireless networks. I am able to con

  • Start Of Ramp-Up for SAP Portfolio and Project Management 5.0

    Start Of Ramp-Up for SAP Portfolio and Project Management 5.0 Starting with this new release, the application SAP Portfolio and Project Management 5.0 replaces both the SAP Resource and Portfolio Management (SAP RPM) application and the Collaboration

  • Finance on a new Intel Mac mini

    Hi, My mac min has just died and i was wondering if i should get the new Intel 1, after just claiming on insurance for my powerbook it seems abit dodgy to claim again, how old in the UK do you have to be to take out finance, as a 15 year old, i havnt

  • Keynote Prints off the Page

    Since upgrading to the latest version of iWork apps, Keynote now prints off the left side of the page. I've noticed that there's no place to set margins. Is there anything I can do to get them to print normally? The current work around has been to sh