Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

248
Views
Java Swing GUI renders behind windows task bar

I am troubling at GUI position of my application. That means in Linux (Centos 6) it's appear correctly from above task bar but in windows 8.1 it's appearing behind the task bar from the bottom of screen. What may would be the issue ?

I am using following code for set dimensions. (I have attached screens below)

UiConfig.getInstance().bottomRightUI(dispalyWidth, displayeHeight);

setBounds(UiConfig.getInstance().getX(), UiConfig.getInstance().getY(),
dispalyWidth, displayeHeight);

Following class used for obtain dynamic dimension from current screen

public class UiConfig {

private static final UiConfig instance = new UiConfig();

public static UiConfig getInstance() {
    return instance;
}

public void bottomRightUI(int width, int height) {
    x = (int) ((screen_width - width));
    y = (int) ((screen_height - height));
}

public int getX() {
    return this.x;
}

public int getY() {
    return this.y;
}

}

On Linux

GUI on Linux

On Windows

GUI on Windows

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

To achieve task bar transparency on Windows, it needs to report the desktop size as "without the taskbar" to have pixels to mix with the alpha channel of the taskbar. When you set the task bar to be non-transparent, you'll get the behavior you desire.

Swing / Java is being fed the numbers on the screen dimensions by the operating system, and if it is fed a set of numbers, it will use them as it's been instructed.

The only fix for this would be to write custom "operating system" detecting code, custom "task bar" detecting code for the problematic operating systems, and write swing reconfiguration routines to "adjust" the dimensions to a smaller footprint despite what the operating system is reporting the footprint is. This kind of code is highly non-portable, and certainly wasn't needed when Swing was created, so it's not in Swing natively.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!