Results 1 to 3 of 3
  1. #1
    AndrewM16921 is offline Senior Member
    Join Date
    Jan 2009
    Location
    CA, USA
    Posts
    264
    Rep Power
    6

    Default Forwarding KeyEvents from JTabbedPane to JPanel

    Hi,

    I have a JTabbedPane with JScrollPane (with JPanel) in each tab. Before I added the tabs, the key events worked fine. Now, it seems like thee tab pane is using the events and blocking it from getting to the panel underneath. What's the best way to fix this?

    Thanks.

    EDIT: fixed with requestFocus, nevermind.
    Last edited by AndrewM16921; 04-22-2014 at 05:24 AM.

  2. #2
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Re: Forwarding KeyEvents from JTabbedPane to JPanel

    fixed with requestFocus,
    Don't use requestFocus()!!! Read the API description for that method. It will tell you the proper method to use.

  3. #3
    AndrewM16921 is offline Senior Member
    Join Date
    Jan 2009
    Location
    CA, USA
    Posts
    264
    Rep Power
    6

    Default Re: Forwarding KeyEvents from JTabbedPane to JPanel

    Oh, requestFocusInWindow()? K, thanks :P

    Also set the JTabbedPane focusable to false, that seemed to be a better solution.

Similar Threads

  1. Move JTabbedPane tabs to another JTabbedPane
    By totalspelnerd in forum AWT / Swing
    Replies: 0
    Last Post: 02-01-2014, 09:08 PM
  2. JTabbedPane coinside w/ JPanel in JFrame help...
    By CodeMangler in forum AWT / Swing
    Replies: 1
    Last Post: 06-04-2012, 10:33 AM
  3. What Event Can Act only on Selected jTabbedPane Among jTabbedPane's
    By raj.mscking@gmail.com in forum AWT / Swing
    Replies: 1
    Last Post: 05-18-2012, 04:39 PM
  4. JScrollPane keyevents
    By Alkor in forum AWT / Swing
    Replies: 4
    Last Post: 03-27-2012, 03:09 AM
  5. Replies: 1
    Last Post: 12-13-2011, 02:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •