Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

250
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda