1

I have created a JFrame with a JSplitPane in it, which contains a canvas in the left and a JPanel in the right. The canvas contains LWJGL display, and the JPanel has few JTextFields in it. The problem is that when I press a mouse button on the LWJGL display, I can't write text into JTextFields anymore. When I minimize the application and return it back, it works until I press on the display again.

Why do i get this problem? How can i fix it?

Note: I can focus on the text fields, but i cant write anything. Maybe the LWJGL is somehow blocking Swings keyboard input?

luke1985
  • 2,265
  • 1
  • 20
  • 32
Qualphey
  • 1,224
  • 1
  • 18
  • 44

1 Answers1

2

By adding a java.awt.Canvas to a javax.swing.JSplitPane, you're Mixing Heavyweight and Lightweight Components. As an alternative, you might try one of the approaches mentioned here.

Community
  • 1
  • 1
trashgod
  • 200,320
  • 28
  • 229
  • 974