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 6920875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:12:15+00:00 2026-05-27T10:12:15+00:00

I am in the process of completing a course work but I need some

  • 0

I am in the process of completing a course work but I need some help understanding this:

“Note: Your application should keep the relative positioning of buttons and checkboxes
when the frame of the application is resized based on the layout managers and the tech-
niques covered in the module. I.e. you should not choose absolute coordinates when
placing JComponents on the screen but relative positioning, i.e. component X is to the
right of component Y and to the left of component Z and these relative locations should
be maintained if the user resizes the frame of the application.”

Does this mean im not to use BoxLayout.X/Y_AXIS? Absolute coordinates?

To my understanding I have to use several panels? If so, my code contains a login and when I login how will I change the colour of the frame?

  • 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-27T10:12:16+00:00Added an answer on May 27, 2026 at 10:12 am

    There’s basically two ways to layout the components in a JFC/Swing application:

    • assign each container a layout manager that will take care of the layout; see the link provided by @Shakedown
    • assign each JComponent an absolute position for it’s top left corner, counting pixels from the top left starting at (0,0) of the top-level-container (see here for what that is) the components are in; see this tutorial on absolute positioning.

    As you can imagine, the second way has some problems: it’s not at all dynamic and is easy to get wrong, to name the most prominent ones. Using a layout manager in most cases is not only the easier, but also the smarter way to arrange your GUI.

    What the layout manager in effect does is assign each JComponent an absolute position derived from the layout the component is layed out by at runtime, dynamically – usually using the PreferredSize of the JComponents; for example, a FlowLayout will assign each JComponent an absolute position that will put it exactly fitting to the right of the JComponent before it, wrapping lines when needed. When a container is resized, all components within it will have their positions recomputed. See here for details.

    Concerning your question about BoxLayout, that is a layout manager; BoxLayout.X_AXIS and BoxLayout.Y_AXIS are used to determine in which direction the JComponents which the BoxLayout manages are to be arranged; they do not refer to absolute positioning. See the Javadocs on BoxLayout and the Java tutorial on BoxLayout for details.

    All in all, your task is to use a layout manager; the different layout managers that are available in the standard java libraries are described in sufficient detail in the tutorials (see links, browse the sites). Have fun!

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

Sidebar

Related Questions

I'm not so familiar with Ajax but I keep hearing Json mentioned as some
We're in the process of completing an application which is based on a licensing
I'm in the process of refactoring some code which includes moving folders around, and
I have a simple application that runs a process that can last for several
I'm trying to automate many repetitive tasks at work and this small problem got
I have some periodic data, but the amount of data is not a multiple
I have 2 MVC apps that need to connect to a 3rd application. The
This is quite an interesting question so let me set the scene. I work
As part of a Linux benchmark application, I have a parent process that forks
Process process = new Process(); ProcessStartInfo psi = new ProcessStartInfo(@C:/PsExec.exe); psi.UseShellExecute = false; psi.RedirectStandardOutput

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.