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

  • Home
  • SEARCH
  • 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 7933281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:17:01+00:00 2026-06-03T21:17:01+00:00

I have a JPanel with components added with absolute locations (ie. pos x y),

  • 0

I have a JPanel with components added with absolute locations (ie. “pos x y”), and the layout is effectively two columns of textfields. What I would like to achieve would be for Tab to shift the focus to the next component vertically, so as to traverse the first column, then the second. At the moment it does it horizontally. I’ve tried to extend FocusTraversalPolicy but what annoyed me was that you have to add it to the JFrame and not just the panel itself – unless that’s incorrect?

How can I achieve this? Thanks.

  • 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-06-03T21:17:02+00:00Added an answer on June 3, 2026 at 9:17 pm

    As far as I know the default focus traversal cycle is the natural order of the childcomponents in a container, i.e. the order in which they were added to the container. I don’t know MigLayout very well, but if you manage to add the components vertically, the focus traversal might follow.

    You can set a FocusTraversalPolicy to any Container, however, Swing will only use it when you call setFocusTraversalPolicyProvider(true) on the same Container.

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

Sidebar

Related Questions

I have a JPanel, which I would like to detect the following events (1)
I have built my own component extending JPanel. I've added a few methods like
I've created JPanel and have already added components into it and I'm going to
I have a JPanel with a grid of JLabels added. I'd like a MouseListener
Give that I have written a JPanel with many different components on it, is
I have a JPanel to which I'd like to add JPEG and PNG images
I have a JPanel that encapsulates two JPanels, one on top of the other.
I have a JPanel with a Grid Layout. In the cells of the grid
I have a problem with my two JList components. I created and placed on
I have a JPanel with several levels of child components, also with a JScrollPane.

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.