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 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

Related Questions

SOLVED see Edit 2 Hello, I've been writing a Perl program to handle automatic
SOLVED: Thanks figured it out thanks to dominic hamon. It all boils down to
Solved I actually found out what is going on here. Turns out it was
@Solved The two subquestions I have created have been solved (yay for splitting this
SOLVED. Code has been edited to reflect solution. Given the following GridView : <asp:GridView
SOLVED http://jsfiddle.net/ArtofLife/u9d9d/ I have multiple TEXTAREA and BUTTON out side.. For inserting string in
SOLVED: View the answer below marked SOLVED. Thanks. I am trying to download a
SOLVED - see Bish below I've got a list of checkboxes that all dump
Solved It turned out I misunderstood what the available() method actually does, so I
[SOLVED (see answer below)] I am using SpreadsheetWorker API to make working with Open

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.