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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:53:00+00:00 2026-05-11T19:53:00+00:00

In my Swing application, I want the ability to switch between decorated and undecorated

  • 0

In my Swing application, I want the ability to switch between decorated and undecorated without recreating the entire frame. However, the API doesn’t let me call setUndecorated() after the frame is made visible.

Even if i call setVisible(false), isDisplayable() still returns true. The API says the only way to make a frame not-displayable is to re-create it. However, I don’t want to recreate the frame just to switch off some title bars.

I am making a full-screenable application that can be switched between fullscreen and windowed modes; It should be able to switch while maintaining the state, etc.

How do I do this after a frame is visible?.

  • 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-11T19:53:00+00:00Added an answer on May 11, 2026 at 7:53 pm

    You can’t. That’s been my experience when I tried to achieve the same.

    However if you have your entire UI in one panel which is in your frame, you can create a new frame and add that panel to the frame. Not so much work.

    Something like this:

    // to start with
    JPanel myUI = createUIPanel();
    JFrame frame = new JFrame();
    frame.add(myUI);
    
    // .. and later ...
    
    JFrame newFrame = new JFrame();
    newFrame.setUndecorated();
    newFrame.add(myUI);
    

    In Swing a panel (and indeed any instance of a component) can only be in one frame at a time, so when you add it to a new frame, it immediately ceases to be in the old frame.

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

Sidebar

Related Questions

I'm putting together a Swing application where I often want to replace the contents
My Java Swing application generates an HTML file, and I want to open it
I am new to Java Swing I want to develop an POS application which
I have a small Java Swing application that I want to rewrite in WPF
I want to make a java swing application from where i can generated xml
I have a Java Swing application client that I want to use to consume
I want to make an object I can add to my java swing application.
I'm writing a new Java 6 Swing application and want to have a Show
I have a Java (Swing) application and I want to anchor it in the
I want to implement a java awt/swing application but i am new to awt/swing.

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.