Hi.. I'm really confused why I can't make my JTextPane focused
I have a jframe with JTabbedPane inside it, inside the JTabbedPane is a JPanel, inside the JPanel is JTextPane included with JScrollpane.
I want to make the JTextPane focused when the window opened, now it focused on the JTabbedPane.
I've tried these
TextPane.setFocusable(true); TextPane.requestFocusInWindow(); TextPane.setFocusCycleRoot(true); TextPane.setFocusTraversalPolicyProvider(true); TextPane.grabFocus(); TextPane.setCaretPosition(0); TextPane.setText("test");
I even tried to turn off the focusable of JTabbedPane to false.
Still I can't make the JTextPane focused.
I also already tried to move the code above before the JFrame.setvisibile(true)
Anyone can help?