Focus Problem on Solaris with jdk 1.3.1

Hi all,
We are having a focus problem on Solaris. The same code works fine on Windows without any problem.
I am sending the test code and run steps below which you can compile and repeat the problem.
NOTE: When we put a comment on the line "f1.requestFocus();" in TestFocus.java it works OK.
Run Steps :
1. Run TestFocus.class
2. A JFrame appears with 2 text field and a button
3. Try to write something on the text fields. It works OK.
4. Click the button to open a new JFrame
5. A new JFrame opens with a single text field and a button.
6. Click the button to close the second frame
7. You are now on the main JFrame
8. Try to write something on the text fields. It works OK.
9. Repeat the steps 4-7
10. Try to write something on the text fields. You are able to focus and write on the first field. BUT you cannot select or write the second Field!
JAVA SOURCE FILES :
PenHesapListener.java :
public interface PenHesapListener extends java.util.EventListener {
void tamam_actionPerformed(java.util.EventObject newEvent);
void iptal_actionPerformed(java.util.EventObject newEvent);
------PenHesapLisEventMulticaster.java----------------------------------
public class PenHesapLisEventMulticaster extends java.awt.AWTEventMulticaster implements PenHesapListener {
* Constructor to support multicast events.
* @param a java.util.EventListener
* @param b java.util.EventListener
protected PenHesapLisEventMulticaster(java.util.EventListener a, java.util.EventListener b) {
     super(a, b);
* Add new listener to support multicast events.
* @return muhasebe.HesappenListener
* @param a muhasebe.HesappenListener
* @param b muhasebe.HesappenListener
public static PenHesapListener add(PenHesapListener a, PenHesapListener b) {
     return (PenHesapListener)addInternal(a, b);
* Add new listener to support multicast events.
* @return java.util.EventListener
* @param a java.util.EventListener
* @param b java.util.EventListener
protected static java.util.EventListener addInternal(java.util.EventListener a, java.util.EventListener b) {
     if (a == null) return b;
     if (b == null) return a;
     return new PenHesapLisEventMulticaster(a, b);
* @return java.util.EventListener
* @param oldl muhasebe.HesappenListener
protected java.util.EventListener remove(PenHesapListener oldl) {
     if (oldl == a) return b;
     if (oldl == b) return a;
     java.util.EventListener a2 = removeInternal(a, oldl);
     java.util.EventListener b2 = removeInternal(b, oldl);
     if (a2 == a && b2 == b)
          return this;
     return addInternal(a2, b2);
* Remove listener to support multicast events.
* @return muhasebe.HesappenListener
* @param l muhasebe.HesappenListener
* @param oldl muhasebe.HesappenListener
public static PenHesapListener remove(PenHesapListener l, PenHesapListener oldl) {
     if (l == oldl || l == null)
          return null;
     if(l instanceof PenHesapLisEventMulticaster)
          return (PenHesapListener)((PenHesapLisEventMulticaster) l).remove(oldl);
     return l;
public void tamam_actionPerformed(java.util.EventObject newEvent) {
     ((PenHesapListener)a).tamam_actionPerformed(newEvent);
     ((PenHesapListener)b).tamam_actionPerformed(newEvent);
public void iptal_actionPerformed(java.util.EventObject newEvent) {
     ((PenHesapListener)a).iptal_actionPerformed(newEvent);
     ((PenHesapListener)b).iptal_actionPerformed(newEvent);
---------TestFocus2.java-----------------------------------------
import javax.swing.*;
import javax.swing.JOptionPane;
import java.awt.event.WindowAdapter;
import java.awt.event.KeyListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.ActionEvent;
import java.awt.event.WindowEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.text.SimpleDateFormat;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.Color;
import java.util.Locale;
import java.util.ResourceBundle;
public class TestFocus2 extends JFrame implements ActionListener
     protected transient PenHesapListener PenhListener = null ;
     JTextField f10 = null;
     JButton b10= null ;
     JTextField f1 = new JTextField() ;
     JButton b1 = new JButton() ;
     JFrame f20 = null;
     public TestFocus2()
          getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
          getContentPane().add(f1);
          getContentPane().add(b1);
          pack();
          setVisible(true);
          b1.addActionListener(this);
     public void actionPerformed(ActionEvent e)
          if(e.getSource() == b1)
               fireTamam_actionPerformed(e);
     public void addPenHesapListener(PenHesapListener newListener)
          PenhListener = PenHesapLisEventMulticaster.add(PenhListener, newListener);
          return;
     protected void fireTamam_actionPerformed(java.util.EventObject newEvent) {
          PenhListener.tamam_actionPerformed(newEvent);
          this.setVisible(false);
     protected void fireiptal_actionPerformed(java.util.EventObject newEvent) {
          PenhListener.iptal_actionPerformed(newEvent);
     public static void main(String x[])
          TestFocus2 gen01 = new TestFocus2();
--------TestFocus.java-----------------------------------
import javax.swing.*;
import javax.swing.JOptionPane;
import java.awt.event.WindowAdapter;
import java.awt.event.KeyListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.ActionEvent;
import java.awt.event.WindowEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.text.SimpleDateFormat;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.Color;
import java.util.Locale;
import java.util.ResourceBundle;
import java.awt.Container;
public class TestFocus extends JFrame implements ActionListener
     PenKreKart aPenKreKart = null ;      
     Container ctn = null;
     JTextField f10 = null;
     JButton b10= null ;
     JTextField f1 = new JTextField() ;
     JTextField f2 = new JTextField() ;
     JButton b1 = new JButton() ;
     JFrame f20 = null;
     public TestFocus()
          //aPenKreKart = new PenKreKart(true);
          //aPenKreKart.aTemelPencere.setVisible(false);
          getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
          getContentPane().add(f1);
          getContentPane().add(f2);
          getContentPane().add(b1);
          pack();
          setVisible(true);
          b1.addActionListener(this);
     public void actionPerformed(ActionEvent e)
          if(e.getSource() == b1)
               pencere_islemi();
     // pencere koyma k?sm? .. begin                               
     public void pencere_islemi() {     
          ctn = this;
          ctn.setEnabled(false);
          TestFocus2 fpen = new TestFocus2();
          //aPenKreKart.aTemelPencere.setVisible(true); //buras?          
          //aPenKreKart.aTemelPencere.addPenHesapListener(new PenHesapListener() {
          fpen.addPenHesapListener(new PenHesapListener() {
                    // metod      tamam_actionPerformed begin...          
                    public void tamam_actionPerformed(java.util.EventObject newEvent) {
                         ctn.setEnabled(true);
                         ctn.requestFocus();
                         // Problem is when we comment the below line it works .....
                         f1.requestFocus();
                         System.out.println("tamam");
                    // metod      tamam_actionPerformed end...          
                    // metod      iptal_actionPerformed begin...          
                    public void iptal_actionPerformed(java.util.EventObject newEvent) {
                         ctn.setEnabled(true);
                         ctn.requestFocus();
                         System.out.println("iptal");
                    // metod      iptal_actionPerformed begin...          
     // pencere koyma k?sm? .. end                               
     public static void main(String x[])
          TestFocus gen01 = new TestFocus();

Hi all,
We are having a focus problem on Solaris. The same code works fine on Windows without any problem.
I am sending the test code and run steps below which you can compile and repeat the problem.
NOTE: When we put a comment on the line "f1.requestFocus();" in TestFocus.java it works OK.
Run Steps :
1. Run TestFocus.class
2. A JFrame appears with 2 text field and a button
3. Try to write something on the text fields. It works OK.
4. Click the button to open a new JFrame
5. A new JFrame opens with a single text field and a button.
6. Click the button to close the second frame
7. You are now on the main JFrame
8. Try to write something on the text fields. It works OK.
9. Repeat the steps 4-7
10. Try to write something on the text fields. You are able to focus and write on the first field. BUT you cannot select or write the second Field!
JAVA SOURCE FILES :
PenHesapListener.java :
public interface PenHesapListener extends java.util.EventListener {
void tamam_actionPerformed(java.util.EventObject newEvent);
void iptal_actionPerformed(java.util.EventObject newEvent);
------PenHesapLisEventMulticaster.java----------------------------------
public class PenHesapLisEventMulticaster extends java.awt.AWTEventMulticaster implements PenHesapListener {
* Constructor to support multicast events.
* @param a java.util.EventListener
* @param b java.util.EventListener
protected PenHesapLisEventMulticaster(java.util.EventListener a, java.util.EventListener b) {
     super(a, b);
* Add new listener to support multicast events.
* @return muhasebe.HesappenListener
* @param a muhasebe.HesappenListener
* @param b muhasebe.HesappenListener
public static PenHesapListener add(PenHesapListener a, PenHesapListener b) {
     return (PenHesapListener)addInternal(a, b);
* Add new listener to support multicast events.
* @return java.util.EventListener
* @param a java.util.EventListener
* @param b java.util.EventListener
protected static java.util.EventListener addInternal(java.util.EventListener a, java.util.EventListener b) {
     if (a == null) return b;
     if (b == null) return a;
     return new PenHesapLisEventMulticaster(a, b);
* @return java.util.EventListener
* @param oldl muhasebe.HesappenListener
protected java.util.EventListener remove(PenHesapListener oldl) {
     if (oldl == a) return b;
     if (oldl == b) return a;
     java.util.EventListener a2 = removeInternal(a, oldl);
     java.util.EventListener b2 = removeInternal(b, oldl);
     if (a2 == a && b2 == b)
          return this;
     return addInternal(a2, b2);
* Remove listener to support multicast events.
* @return muhasebe.HesappenListener
* @param l muhasebe.HesappenListener
* @param oldl muhasebe.HesappenListener
public static PenHesapListener remove(PenHesapListener l, PenHesapListener oldl) {
     if (l == oldl || l == null)
          return null;
     if(l instanceof PenHesapLisEventMulticaster)
          return (PenHesapListener)((PenHesapLisEventMulticaster) l).remove(oldl);
     return l;
public void tamam_actionPerformed(java.util.EventObject newEvent) {
     ((PenHesapListener)a).tamam_actionPerformed(newEvent);
     ((PenHesapListener)b).tamam_actionPerformed(newEvent);
public void iptal_actionPerformed(java.util.EventObject newEvent) {
     ((PenHesapListener)a).iptal_actionPerformed(newEvent);
     ((PenHesapListener)b).iptal_actionPerformed(newEvent);
---------TestFocus2.java-----------------------------------------
import javax.swing.*;
import javax.swing.JOptionPane;
import java.awt.event.WindowAdapter;
import java.awt.event.KeyListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.ActionEvent;
import java.awt.event.WindowEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.text.SimpleDateFormat;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.Color;
import java.util.Locale;
import java.util.ResourceBundle;
public class TestFocus2 extends JFrame implements ActionListener
     protected transient PenHesapListener PenhListener = null ;
     JTextField f10 = null;
     JButton b10= null ;
     JTextField f1 = new JTextField() ;
     JButton b1 = new JButton() ;
     JFrame f20 = null;
     public TestFocus2()
          getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
          getContentPane().add(f1);
          getContentPane().add(b1);
          pack();
          setVisible(true);
          b1.addActionListener(this);
     public void actionPerformed(ActionEvent e)
          if(e.getSource() == b1)
               fireTamam_actionPerformed(e);
     public void addPenHesapListener(PenHesapListener newListener)
          PenhListener = PenHesapLisEventMulticaster.add(PenhListener, newListener);
          return;
     protected void fireTamam_actionPerformed(java.util.EventObject newEvent) {
          PenhListener.tamam_actionPerformed(newEvent);
          this.setVisible(false);
     protected void fireiptal_actionPerformed(java.util.EventObject newEvent) {
          PenhListener.iptal_actionPerformed(newEvent);
     public static void main(String x[])
          TestFocus2 gen01 = new TestFocus2();
--------TestFocus.java-----------------------------------
import javax.swing.*;
import javax.swing.JOptionPane;
import java.awt.event.WindowAdapter;
import java.awt.event.KeyListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.ActionEvent;
import java.awt.event.WindowEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.text.SimpleDateFormat;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.Color;
import java.util.Locale;
import java.util.ResourceBundle;
import java.awt.Container;
public class TestFocus extends JFrame implements ActionListener
     PenKreKart aPenKreKart = null ;      
     Container ctn = null;
     JTextField f10 = null;
     JButton b10= null ;
     JTextField f1 = new JTextField() ;
     JTextField f2 = new JTextField() ;
     JButton b1 = new JButton() ;
     JFrame f20 = null;
     public TestFocus()
          //aPenKreKart = new PenKreKart(true);
          //aPenKreKart.aTemelPencere.setVisible(false);
          getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
          getContentPane().add(f1);
          getContentPane().add(f2);
          getContentPane().add(b1);
          pack();
          setVisible(true);
          b1.addActionListener(this);
     public void actionPerformed(ActionEvent e)
          if(e.getSource() == b1)
               pencere_islemi();
     // pencere koyma k?sm? .. begin                               
     public void pencere_islemi() {     
          ctn = this;
          ctn.setEnabled(false);
          TestFocus2 fpen = new TestFocus2();
          //aPenKreKart.aTemelPencere.setVisible(true); //buras?          
          //aPenKreKart.aTemelPencere.addPenHesapListener(new PenHesapListener() {
          fpen.addPenHesapListener(new PenHesapListener() {
                    // metod      tamam_actionPerformed begin...          
                    public void tamam_actionPerformed(java.util.EventObject newEvent) {
                         ctn.setEnabled(true);
                         ctn.requestFocus();
                         // Problem is when we comment the below line it works .....
                         f1.requestFocus();
                         System.out.println("tamam");
                    // metod      tamam_actionPerformed end...          
                    // metod      iptal_actionPerformed begin...          
                    public void iptal_actionPerformed(java.util.EventObject newEvent) {
                         ctn.setEnabled(true);
                         ctn.requestFocus();
                         System.out.println("iptal");
                    // metod      iptal_actionPerformed begin...          
     // pencere koyma k?sm? .. end                               
     public static void main(String x[])
          TestFocus gen01 = new TestFocus();

Similar Messages

  • Browser focus problem

    Hello.
    We have a problem with focus on our web forms.
    In our form we have one button. When the user clicks on the button, cursor appears in one item.
    But when the user clicks outside the form (but still inside browser) and then back on the form, cursor is not visible. And if the user then clicks on the button, cursor is still not visible. Only when the user clicks into the item manually cursor appears.
    Annoying.
    Is there any solution for this?
    Thanks.

    a known forms focusing problem is fixed with SUN JRE 1.5_12. Also try to use the latest JInitiator if you don't want to use SUN JRE (on unix clients, you don't have any other option but to use SUN JRE). I recommend using Firefox on both unix and windows clients.
    I hope this proves useful.

  • 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.

  • 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);
    }

  • 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

  • Significant Computer Window Focus Problem With Verizon Access Manager 7.7.1.0 (2707e)

    With the newly released Verizon Access Manager 7.7.1.0 (2707e) there is a significant computer focus problem with it.
    What I mean by this is that if I am using ANY application on my computer with the Verizon Access Manager minimized to the Windows System Tray, something will go on with the Verizon Access Manager and it steals the window focus - I am unable to work in the other application unless I click on the application to use it again.  
    An example of this would be my typing to post a message in this forum.  Something occurs in the Verizon Access Manager and my typing is rendered useless unless I click with my mouse on the browser window to be able to use it again.
    I'm highly suspecting whenever networks are coming and going in the Access Manager is when the problem occurs.
     This problem did not exist in the previous version of the Access Manager I was using.
    This is extremely annoying - please issue a fix for this ASAP!

    I have found by not minimzing the Verizon Access Manager 7.7.1.0 (2707e) the focus problem does not occur - it appears to be a problem when the app is minimzed to the system tray.

  • Problems with jdk 1.4.2_03

    Hi, I know that this question has been made many times but I can't get solve my problem.
    I have jdk 1.4.2_03 and I'm using IE 6
    I have been reading "Getting started" tutorial and I can't see the applet , the java console sends a lot of errors:
    java.lang.NoClassDefFoundError: ParseException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    I configure:
    classpath and path.
    tools/internet options/advanced jvm and java(sun)
    java plug-in it's IE checked.
    All of them are correct.
    What can I do ??
    Please help meeeeee ......... : (

    Hi, I know that this question has been made many times
    but I can't get solve my problem.
    I have jdk 1.4.2_03 and I'm using IE 6
    All of them are correct.
    What can I do ??Maybe you could give some more information: which applet, did it compile (javac) without errors, did you put it in the right directory ?
    Mylene

  • Business objects xi 3.1 sp3 on solaris , is it compatable with jdk 1.6

    i installed business objects xi 3.1 sp3 on soalris and we are using apache tomcat web application server. wheni read  Supported Platform document it says business objects comes with jdk 1.5 . do we have an option such that we can point to jdk 1.6. we are having jdk 1.6 in the /usr/jdk.1.6.023. can we point our whole business objects to that jdk 1.6.
    help appreciated
    thanks

    Hi,
    i know that you can re- point the Tomcat WAS to a different JDK but i am not aware that you can point BOE to a different one.
    I would recommend you open a OSS Message with the SAP support to check if it is possible and supported.
    Regards
    -Seb.

  • Problem with installing Java EE with JDK Bundle

    Hello everyone
    I downloaded the Java EE SDK with JDK update 25 bundle for linux
    The file end in .sh. however when I run the executable I get the no jar found message. Do I need to install jdk before I install jee and if I do then why do they provide them bundled if you have to have the jdk first before installing jee.
    Another question also, how do I change my handle in this forum? I didn't pick this number!!

    Yes, it is a bit stupid. You need the jar command which usually is available if you have a JDK installed but there are other ways of just installing just jar. Also note that some people already have an older JDK installed, thus jar is available and when they install this bundle they get a newer JDK.
    Anyway, for changing your handle, you can do that from 'Your Control Panel' and then Edit your profile.

  • A problem with jdk 1.6

    when I compile my java files, class file are produced after debbug.
    but when i try to run my program (my class with main method ), I get this error message "error on thread main ...." .
    so what can I do to run my classes?thanks for the help.
    PS: I use command line on windows xp.

    Hi,
    I have such problem too.
    With JRE under Windows.
    Applets are executed properly.
    But programmes for interpriter java.com
    are compiled without errors but
    are not work under JRE 1.6.
    After:
    java.com programme.class,
    I get error message:
    "Exception in thread "main" java.lang.NoClassDefFoundError: HelloJava/class".
    for any programmes. Even for class with empty main function.
    Second problem with compiler for Windows:
    When source file programme.java
    in UTF-8, the first symbol in file is spetial for unicode
    files in Windows.
    The compiler writes an error message and stops.

  • Application crashes when using JNI with Jdk 1,2, 1.3 and 1.4

    Hi!
    I have this application that has a GUI written in Java and a file parser written in C. JNI is used to connect these parts together. The problem is that the application only works when I am using jdk 1.1.8 but not when using jdk1.2, jdk1.3 or jdk1.4. I am running the application on a Solaris 8 machine.
    I have not written the application myself but I am going to be working with it from now on. But I have today little knowledge with JNI and I have tried different approaches to solve the problem. For example I have tried to used DDD together with GDB to find out what the problem is but with no luck. When I run the application using jdk1.4 I get the following error when the JVM crashes:
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : 10 occurred at PC=0xFA023164
    Function=Java_Bitmap_setDebug+0x1C
    Library=/usr/u/lal/micview/micview2_1_0_beta1/libBitmapImpl.so
    Current Java thread:
    at Bitmap.setDebug(Native Method)
    at DisplayPanel.loadFile(DisplayPanel.java:396)
    at MicPlot.loadFile(MicPlot.java:1452)
    at MicPlot.loadFile(MicPlot.java:1441)
    at MicPlot.miOpen_Action(MicPlot.java:1267)
    at MicPlot$SymAction.actionPerformed(MicPlot.java:1184)
    at java.awt.MenuItem.processActionEvent(MenuItem.java:588)
    at java.awt.MenuItem.processEvent(MenuItem.java:548)
    at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:285)
    at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:273)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:452)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    Dynamic libraries:
    0x10000 /opt/java/jdk1.4/bin/java
    0xff360000 /usr/lib/libthread.so.1
    0xff3a0000 /usr/lib/libdl.so.1
    0xff280000 /usr/lib/libc.so.1
    0xff270000 /usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1
    0xfe000000 /opt/java/j2sdk1.4.1/jre/lib/sparc/client/libjvm.so
    0xff220000 /usr/lib/libCrun.so.1
    0xff200000 /usr/lib/libsocket.so.1
    0xff100000 /usr/lib/libnsl.so.1
    0xff1d0000 /usr/lib/libm.so.1
    0xff250000 /usr/lib/libw.so.1
    0xff0e0000 /usr/lib/libmp.so.2
    0xff0b0000 /opt/java/j2sdk1.4.1/jre/lib/sparc/native_threads/libhpi.so
    0xff080000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libverify.so
    0xff030000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libjava.so
    0xfe7e0000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libzip.so
    0xfe4e0000 /usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.2
    0xedd00000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libawt.so
    0xfc480000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libmlib_image.so
    0xfc410000 /opt/java/j2sdk1.4.1/jre/lib/sparc/motif21/libmawt.so
    0xeda80000 /usr/dt/lib/libXm.so.4
    0xfa090000 /usr/openwin/lib/libXt.so.4
    0xfa3d0000 /usr/openwin/lib/libXext.so.0
    0xfc7e0000 /usr/openwin/lib/libXtst.so.1
    0xed980000 /usr/openwin/lib/libX11.so.4
    0xfa2a0000 /usr/openwin/lib/libdps.so.5
    0xfa3b0000 /usr/openwin/lib/libSM.so.6
    0xfa1d0000 /usr/openwin/lib/libICE.so.6
    0xed880000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libfontmanager.so
    0xfa390000 /usr/openwin/lib/locale/common/xlibi18n.so.2
    0xfa1b0000 /usr/openwin/lib/locale/iso8859-1/xomEuro.so.2
    0xfa190000 /usr/lib//liblayout.so
    0xfa050000 /usr/openwin/lib/locale/common/ximlocal.so.2
    0xfa010000 /usr/u/lal/micview/micview2_1_0_beta1/libBitmapImpl.so
    Local Time = Thu Oct 3 13:32:47 2002
    Elapsed Time = 35
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.1-beta-b14 mixed mode)
    # An error report file has been saved as hs_err_pid27692.log.
    # Please refer to the file for further information.
    Abort
    From this information I think that the problem should be in the native method setDebug. But I have tried to set a breakpoint at the beginning of that function in the C part but with no luck. The application crashes before it reaches that position in the C file.
    What could possibly go wrong between the setDebug function in the C part and the function call in the Java part?
    When using GDB, GDB cannot figure out what is wrong it just returns a hex address, no function name.
    I would really appreciate some help. I have tried everything that I can come up with!
    Best regards
    Lars

    I have figured out that the application fails on its first call to the native methods.
    So I have this Bitmap class that contains all the native calls and it is defined shortly as follow:
    public class Bitmap {
    static {
    System.loadLibrary("BitmapImpl");
    native void setDebug(int debuglevel, int statistics);
    There are many more native methods defined in Bitmap, but I only show the setDebug method because that is the first one that is executed and also the one that immediately fails.
    My setDebug C function is defined as follow in BitmapImpl.c
    #include <time.h>
    #include <stdio.h>
    #include <limits.h>
    #include <fcntl.h>
    #include <jni.h>
    #include <math.h>
    #include <errno.h>
    #include "Bitmap.h"
    #include "data.h"
    jint debug = 0;
    jint statistics = 1;
    JNIEXPORT void JNICALL Java_Bitmap_setDebug
    (JNIEnv *jenv, jobject jo, jint d, jint s)
    debug = d;
    statistics = s;
    My libBitmapImpl.so file is compiled using the following Makefile and using GNU gcc:
    JAVAPATH=$(JAVAINCLUDEPATH)
    LMACRO=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSOLARIS
    CSOURCE=BitmapImpl.c
    all:
    gcc -O3 -G $(LMACRO) -I$(JAVAPATH) -I$(JAVAPATH)/solaris \
    $(CSOURCE) -o libBitmapImpl.so
    It is still a total mystory why the application fails. I have tried it on a RedHat Linux machine and there it works fine. But not on Solaris. Only if I use the jdk1.1.8 but not a later one.
    Would really appreiciate some help!
    Best regards
    Lars

  • Focus Problem -- Two Non Modal Dialogs

    Hi ,
    In my applet, when user does something which is not allowed, I display an error message box (JOptionPane dialog - modal).
    There is another dialog box (non modal) that user
    can open to view search results and put it aside the
    applet window to do some parallel work.
    Now when error message dialog appears, the search
    dialog box also pops up even if the user
    has put this behind the applet window (by clicking browser window or applet, the search dialog goes behind the window).
    Can you please let me know, how can I get rid
    of this search dialog (non-modal) popup. I mean
    search dialog should remain open but should not
    come infront (ie should not get focus) when modal
    error message dialog pops up.
    NOTE: I don't want to make search dialog
    a modal dialog.
    Thanx,
    [email protected]

    Thanks for the reply michael. I forgot to mention particularly during my post that i am facing this problem on Solaris system. Running the same application on windows is working fine. I can't make other non-modal dialogs visibility to false because they should be visible on the screen all the time throught out the application life cycle and making it visible/non-visible doesn't get sense in my application. Does anybody is facing the same problem with Solaris system? Plz help.
    Hitesh

  • Weblogic Core Dumps on Solaris with Hotspot Server VM

    For Sun Microsystems SPARC with Solaris 2.7 the supported platform is
    "SunSoft SDK 1.3.1 JavaTM 2 Runtime Environment, Standard Edition (build
    1.3.1-b24) Java HotSpotTM Server VM (build 1.3.1-b24, mixed mode)"
    We have set the MaxPermSize as specified below and are still receiving
    periodic core dumps in a production environment. The most recent of which
    is "Unexpected Signal : 11 occurred at PC=0xee4b5d00 Function
    name=JVM_CurrentTimeMillis" a reported bug on Sun's bug parade (Bug Id
    #4488864). Are there some other settings that we should try? Is there a
    more stable VM we should be using like "SunSoft SDK 1.3.0 JavaTM 2 Runtime
    Environment, Standard Edition (build 1.3.0) "?
    Help would be appreciated,
    Thanks
    Problems with JDK 1.3 crashing
    If you have problems with OutOfMemory errors and the JVM crashing with JDK
    1.3, try setting: -XX:MaxPermSize=128m. There is currently an open bug on
    Sun's bug parade that describes this problem. See,
    http://developer.java.sun.com/developer/bugParade/bugs/4390238.html

    FYI: Stability seems to have been achieved by setting:
    -XX:MaxNewSize=64m
    -XX:MaxPermSize=128m
    "Paul Hamill" <[email protected]> wrote in message
    news:[email protected]..
    Unfortunately we tried switching to client and we still periodically getthe
    core dumps.
    "Dimitri Rakitine" <[email protected]> wrote in message
    news:[email protected]..
    I'd be interested to know this as well - so far the only stable option
    that I know of is to use client JVM. Server Hotspot crashes, sooner
    or later. 1.3.1-b24 server crashes as well, but not the client JVM.
    Paul Hamill <[email protected]> wrote:
    For Sun Microsystems SPARC with Solaris 2.7 the supported platform is
    "SunSoft SDK 1.3.1 JavaTM 2 Runtime Environment, Standard Edition
    (build
    1.3.1-b24) Java HotSpotTM Server VM (build 1.3.1-b24, mixed mode)"
    We have set the MaxPermSize as specified below and are still receiving
    periodic core dumps in a production environment. The most recent of
    which
    is "Unexpected Signal : 11 occurred at PC=0xee4b5d00 Function
    name=JVM_CurrentTimeMillis" a reported bug on Sun's bug parade (Bug Id
    #4488864). Are there some other settings that we should try? Is
    there
    a
    more stable VM we should be using like "SunSoft SDK 1.3.0 JavaTM 2Runtime
    Environment, Standard Edition (build 1.3.0) "?
    Help would be appreciated,
    Thanks
    Problems with JDK 1.3 crashing
    If you have problems with OutOfMemory errors and the JVM crashing with
    JDK
    1.3, try setting: -XX:MaxPermSize=128m. There is currently an open bugon
    Sun's bug parade that describes this problem. See,
    http://developer.java.sun.com/developer/bugParade/bugs/4390238.html
    Dimitri

  • 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);
    }

Maybe you are looking for

  • Unable to clear text Field in Multi Screen JFrame GUI Application

    i am working with a Swing GUI project where I want to accept user input in a text field I have used singleton pattern which will create only one instance of object due to this when i move from one scree to another the input of textfield doesnt update

  • Connection Pool establishment problem

    Hi Experts, we have one application with JCo mechanism. For this application, we are using one properties file, which holds ABAP connection information. From this connection information(sapconn.props), we created connection pool and fetching data fro

  • SSO using Kerberos with SAP Logon Tickets

    Hi, I am creating a Repository Manager for the Portal Knowledge Management System and I want to use SSO to a backend IIS application and I have a few questions here.  I have a three tiered architecture.  A.  The presentation tier (SAP Portal which ha

  • Mini CD stuck in my drive!

    I put a mini-cd inside my optical drive not knowing my drive didn't support these cds and now I can't get it out. Any tips?

  • Ports to open for Jabber to work

    Hi, I want to know which ports I should allow on ACL which will allow Jabber on iOS and Android devices to work successfully. Thanks, Kashish