Menu

Tab Key Java 1.5

Help
2005-11-14
2013-04-11
  • Paul Zepernick

    Paul Zepernick - 2005-11-14

    Has anyone had any issues with the tab key in Java 1.5?  We are using scoansi and in Java 1.5 it is printing unknown esape character to the console.  It works fine under Java 1.4

    Thanks,

    Paul

     
    • Paul Zepernick

      Paul Zepernick - 2005-11-15

      The unkown escape was not the real problem.  That message was coming from something else. 

      We did some digging through the code today and found the problem.  The problem lies in jta.de.mud.terminal.SwingTerminal

      This code was in the constructor:

          if (version.startsWith("1.4")) {
            try {
              Class params[] = new Class[]{boolean.class};
              SwingTerminal.class.getMethod("setFocusable", params).invoke(this, new Object[]{new Boolean(true)});
              SwingTerminal.class.getMethod("setFocusTraversalKeysEnabled", params).invoke(this, new Object[]{new Boolean(false)});
            } catch (Exception e) {
              System.err.println("vt320: unable to reset focus handling for java version " + version);
              e.printStackTrace();
            }
          }

      It needs to be changed to say 1.4 > on the version instead of just looking at 1.4.  We are going to make an attempt to parse the version as a double and do the comparison.

      Paul

       
    • Nobody/Anonymous

      TAB key does not seem to work in JTA. In other Telnet client, using TAB will complete the commmand but it JTA, it does not have any effect.

      I am using jta26(latest with copy/paste patch) on Java java 1.5 too.

       
    • Nobody/Anonymous

      It is due to the problem which is outlined in my 2nd post.  We changed the code to the following:

          /* we have to make sure the tab key stays within the component */
          String version = System.getProperty("java.version");
          String versionStart = version.substring(0,3);
          double ver = Double.parseDouble(versionStart);
          if (ver >= 1.4) {
          //if (version.startsWith("1.5")) {
            try {
              Class params[] = new Class[]{boolean.class};
              SwingTerminal.class.getMethod("setFocusable", params).invoke(this, new Object[]{new Boolean(true)});
              SwingTerminal.class.getMethod("setFocusTraversalKeysEnabled", params).invoke(this, new Object[]{new Boolean(false)});
            } catch (Exception e) {
              System.err.println("vt320: unable to reset focus handling for java version " + version);
              e.printStackTrace();
            }
          }

      I will add a patch for it in the project.

      If you need to get it to work in the mean time, 1.4 will solve your problem.

      Paul

       
    • Goh Bee Hock

      Goh Bee Hock - 2005-11-18

      Paul,

      Does it work now under 1.5 with your patch?

      regards,
      Bee Hock.

       
    • Nobody/Anonymous

      Yes

      - Paul

       

Log in to post a comment.