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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:44:17+00:00 2026-05-13T10:44:17+00:00

(SOLVED: a WindowStateListener and a deferred call to toBack whenever the window is focused)

  • 0

(SOLVED: a WindowStateListener and a deferred call to toBack whenever the window is focused)

Hello all!

I’ve been trying to figure out how to make a java.awt.Window (any subclass will do) so that it cannot be brought to the front. I’m working on a Java “Samurize-like” program that appears below all the application windows and displays Widgets on the screen. Just like “Always on top windows with Java“, I’m hoping for something simple, hopefully just a single method call, if possible, but I’ve checked through the API docs and I’ve had no luck.

Edit:
Sorry, I meant “always on bottom” rather than simply “unfocusable”.

Here’s a basic test case. When clicking on the Window, it should not come above any others currently on the screen:

import java.awt.*;
import javax.swing.*;

public class Main extends JFrame {
    public Main() {
        Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();

        setFocusable(false);
        setFocusableWindowState(false);
        setBounds(new Rectangle(dim));

        toBack();
    }

    public static void main(String[] args) {
        new Main().setVisible(true);
    }
}
  • 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-13T10:44:17+00:00Added an answer on May 13, 2026 at 10:44 am

    You want to use setFocusableWindowState(false)

    (fwiw, this was in the API document linked by the top answer of the post you referred to)

    edit: what about adding a listener to window state change that executes toBack()?

    edit: you might also consider overriding the toFront method to prevent anything from pulling the window to the front.

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

Sidebar

Ask A Question

Stats

  • Questions 261k
  • Answers 261k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer PersonInstance will be populated on the controller. When you submit… May 13, 2026 at 11:38 am
  • Editorial Team
    Editorial Team added an answer If you are talking about this DataContractSerializer then the following… May 13, 2026 at 11:38 am
  • Editorial Team
    Editorial Team added an answer There is a known issue with certificate revocation list checks… May 13, 2026 at 11:38 am

Related Questions

This problem must have been solved a million times, but Google has not been
Using assorted matrix math, I've solved a system of equations resulting in coefficients for
Interested in description of your most used ASP.NET httpmodules that solved a specific problem
I'm asking this question because I finally solved a problem that I have been
After having this question answered through a link to an external site , I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.