Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double focus problem with Swing #16

Open
spike83 opened this issue Apr 27, 2017 · 1 comment
Open

Double focus problem with Swing #16

spike83 opened this issue Apr 27, 2017 · 1 comment

Comments

@spike83
Copy link

spike83 commented Apr 27, 2017

I got a prblem when using noa-libre with Swing.
When I'm focusing the Writer and typing and then klick on swing component like JTextField there are two cursors blinking one in Writer and another in JTextField. Text input is appended to the writer.

This happens with Java > 1.6 on Windows even with the latest Java 1.8 and latest LibreOffice 5.2.6.2.

I used the SimpleApp and added the JTextField to demonstrate:

    noaPanel = new JPanel();
    JTextField field = new JTextField();
    getContentPane().add(noaPanel);
    getContentPane().add(field);

The problem does not appear with Java 6.

Any ideas how to fix or work around.

@lfcnassif
Copy link

lfcnassif commented Feb 12, 2019

Hi, I also have this issue. Currrently I am using the workaround below:

private int delta = 1;

public void releaseFocus() {
    if (officeFrame != null) {
      try {
        officeFrame.getXFrame().getContainerWindow().setVisible(false);
        officeFrame.getXFrame().getContainerWindow().setVisible(true);
        noaPanel.setSize(noaPanel.getWidth() + delta, noaPanel.getHeight());
        delta *= -1;
      } catch (Exception e) {
      }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants