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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:21:45+00:00 2026-05-22T16:21:45+00:00

every time when I call pack() method on JFrame, it moves to the initial

  • 0

every time when I call pack() method on JFrame, it moves to the initial position where was when started. When I try to get the location of the JFrame (getLocation, getLocationOnScreen) it’s still the same as initial position no matter I’m moving the window. I am running Archlinux with Awesome WM. Please help.

Thanks Uiii

EDIT: What I just want is to be able to show or hide some components in the main window (which cause layout resizing) without moving the windows to the initial position.

EDIT2: So I just found that Paŭlo (from comment) is right. It works fine in Xfce, but in Awesome WM not.

EDIT3: I really don’t understand why are you voting the question down. It’s the first time I’m using pack() function, so I don’t know what is its correct behavior. There is no explanation in the java API document if the window’s position will change. I just use this the first in Awesome WM which I am using as my window manager, so I don’t know that should behave another way. I have tried to find something about it on the internet but found nothing. I think that this question can be useful to someone after I’ve found the solution. There are certainly another java developers who are using Awesome WM (or some similar with the same problem).

  • 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-22T16:21:46+00:00Added an answer on May 22, 2026 at 4:21 pm

    I’ve found solution! The problem is that java has some problems with some window managers. Solution is simple – just install wmname utility ( http://tools.suckless.org/wmname ) and run ‘wmname LG3D‘. It changes actual window manager’s name to LG3D and java consider it as compatible WM.

    I know this before my problem. So I am trying to set the LG3D name globally in .xinitrc file but it looks like not working. I have to call ‘wmname LG3D‘ explicitely in every terminal which will run some java apps.

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

Sidebar

Related Questions

Every time I call this method my NSMutableData is leaking and I cannot figure
Just once to get the address location and use it forever? Every time a
I'd like to avoid casting a delegate every time I call MarkAsPermanent method. Here's
anybody tried running native code on WP7? http://blog.walshie.me/2010/11/ every time i call Invoke() method
Python is creating a folder in my directory every time I call this method.
Can I make ComboBox from AjaxToolkit make call to server every time new letter
I have noticed that regardless of a given script's execution time, every date() call
I want to append a newline to my string every time I call file.write()
I have this code I am working on but every time I call init
I'm using JSON.simple to generate JSON output from Java. But every time I call

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.