Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7513395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:10:22+00:00 2026-05-30T00:10:22+00:00

I have embedded 3 ‘TABS’ on top of a form. Each tab has a

  • 0

I have embedded 3 ‘TABS’ on top of a form. Each tab has a ‘LIST’. Whenever I change focus from one tab to another, I want my lists to have focus. How do I ensure that my lists always have focus?
I navigate using gameKeyEvents. I have added an actionListener to my form for game key events. I cannot override the keyReleased() method of the form as I need to add an action listener to my form(it contains other commands too).

I tried overriding the keyreleased() method of my ‘Tabs’ class , but thats not working(WHY??). Nothing happens.

Tabs holder = new Tabs()
    {
        public void keyReleased(int keyEvent)
    {
    System.out.println("key release is working"); // this statement does not work
    }
      };

When i shift tabs by navigating through left and right keys, my lists lose focus (their selection appears faded) and at other times they hold focus (their selection appears solid.)
How do I ensure that my lists always have focus? This is very essential for my program to work. I have attached the snapshots. Please assist.

Please see the attached pictures.

In picture 1, you will see that the list item 3 is highlighted. Now, if I press the left/right/down game keys …the focus disappears from the list and goes to the tab at 3rd position. I WANT TO PREVENT THIS. (not able to post images cuz am a new user. please check the links)

enter image description here

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:10:24+00:00Added an answer on May 30, 2026 at 12:10 am

    Derive the Form and override keyReleased/keyPresed to detect game key right/left.

    When you get a right or left key never call super (always call super for other cases).

    In the keyPressed method if you get right/left just switch a tab and call the requestFocus() method for the appropriate list.

    You need to get the tab buttons from the Tabs component and set them to be focusable false to prevent the list from losing its focus.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have embedded a Google Map in my website. I want to change its
In my Java code I have embedded a SQL query which fetches data from
I have the structure where A Participant will have embedded many Had_drinks objects.. each
Im trying to create a custom formatter in Symfony 1.4. I have embedded form
Actually I wish I knew where to start from... I have embedded an third
I have XML coming from a source that I can't change. They send it
we have embedded the .NET WebBrowser control (actually two in different tabs, if that
I have embedded videos from Vimeo onto my site but it doesn't seem to
I have embedded VLC player into an MFC MDI application. Whenever I close the
I have embedded a JTextArea on a JScrollPane and am using that JTextArea for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.