Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Swing incorrect behaviour from JRE5 to JRE6

  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Swing incorrect behaviour from JRE5 to JRE6

    When I am running my application with JRE5 it is working fine. While working with JRE6 I found below mentioned issue.

    I am generating jframe. After that clicking on text tool of my toolbar I am opening a JTextPane (In JInternalFrame) on the frame with Linux xvkbd keyboard. Using keyboard focus button I should be able to give focus to JTextPane and add text when click on Linux xvkbd keyboard.

    When running with JRE5 I am able to give focus to JTextPane and enter text. But in case of JRE6 I am not able to give focus to JTextPane while clicking on this, the focus is going to parent (blank buffered image page) not to JTextPane. I am pasting a sample code below.

    I am adding the code below. This code is using xvkbd keyboard of Ubuntu/Linux keyboard. In case you don't see the xvkbd keyboard please execute this command in terminal.

    apt-get install xvkbd (This command will install the xvkbd keyboard on your system).

    After running the below code please click on the focus key of xvkbd keyboard and click on the JTextPane added on JIF. Try to enter text in JTextPane from xvkbd keyboard, on JRE5 I am able to enter text in the JTextPane but on the JRE6 could not. Please suggest something on this problem.

     package com.focus;
    import javax.swing.JFrame;
    import javax.swing.JTextField;
     
    public class textFieldText {
     
    public static void main(String args[])
    {
    JFrame jf = new JFrame();
    JTextField txtF = new JTextField();
    jf.add(txtF);
    jf.pack();
    jf.setSize(200, 200);
    jf.setVisible(true);
    }
    }

    Regards,
    Last edited by singhkanhaiya; August 25th, 2009 at 01:22 AM.


  2. #2
    Junior Member
    Join Date
    Jul 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Swing incorrect behaviour from JRE5 to JRE6

    This issue is very critical for us. Any suggestion on this.

Similar Threads

  1. How to Add ActionListener to a JButton in Swing?
    By JavaPF in forum Java Swing Tutorials
    Replies: 17
    Last Post: April 24th, 2013, 05:14 PM
  2. Java program to Add a JMenu toolbar to a Java Swing application
    By JavaPF in forum Java Swing Tutorials
    Replies: 6
    Last Post: March 6th, 2012, 12:25 PM
  3. How to Use a JSlider - Java Swing
    By neo_2010 in forum Java Swing Tutorials
    Replies: 4
    Last Post: March 29th, 2010, 09:33 AM
  4. How to Use the JList component - Java Swing
    By neo_2010 in forum Java Swing Tutorials
    Replies: 1
    Last Post: July 11th, 2009, 04:02 AM