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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:34:03+00:00 2026-05-22T16:34:03+00:00

I intend to use a JInternalFrame as a modal JDialog in full-screen mode, however,

  • 0

I intend to use a JInternalFrame as a modal JDialog in full-screen mode, however, it is not currently being shown when it gets called. Do I need to add it to some container? I tried adding it to a JOptionPane.showInternalMessage(…), but since I want to make the dialog to go away automatically after 3 seconds, this would not work, as the the JOptionPane dialog would just stay there until someone clicks OK.

Any idea? Many thanks.

  • 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-22T16:34:04+00:00Added an answer on May 22, 2026 at 4:34 pm

    Yes you have to add it to a container in which you want it to be ‘internal’.

    Below you have an example which shows you this behaviour. You can notice here that the internal frame (which will appear/hide on mouse press inside the frame) is not painted over the EAST panel, as it is clipped when it goes outside the borders of its parent.

    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.FlowLayout;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JInternalFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    
    public class InternalFrameTest extends JPanel
    {
        private static final long serialVersionUID = 1L;
        private JInternalFrame internalFrame;
        public InternalFrameTest()
        {
            this.internalFrame = new JInternalFrame("Internal frame");
            internalFrame.setLayout(new FlowLayout());
            internalFrame.add(new JLabel("I am label"));
            internalFrame.add(new JButton("Oi button"));    
            internalFrame.pack();
            add(internalFrame);
        }
    
        public void showHideInternalFrame()
        {
            internalFrame.setVisible(!internalFrame.isVisible());
        }
        public static void main(String[] args)
        {
            SwingUtilities.invokeLater(new Runnable()
            {
                @Override
                public void run()
                {               
                    final InternalFrameTest ift = new InternalFrameTest();
                    ift.setBackground(Color.GREEN);
                    JFrame f = new JFrame();
                    f.addMouseListener(new MouseAdapter() 
                    {
                        @Override
                        public void mousePressed(MouseEvent e)
                        {
                            super.mousePressed(e);
                            ift.showHideInternalFrame();
                        }                   
                    });
                    JPanel cp = new JPanel(new BorderLayout());
                    cp.add(ift);
                    JPanel eastP = new JPanel();
                    eastP.add(new JLabel("EAST"));
                    eastP.setBackground(Color.YELLOW);
                    cp.add(eastP, BorderLayout.EAST);
                    f.setContentPane(cp);
                    f.setSize(400, 300);
                    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    f.setVisible(true);
                }
            });
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am currently learning Zend Framework 1.10 and intend to use Doctrine 2. however
I intend to use Reinforcement learning in my project but I do not know
So..I intend to use a Model View Presenter(the passive mode, in which the UI
I am currently developing a jquery function which I intend to use to replace
I'm new to akka and intend to use it in my new project as
I have declared a DataTemplate in Window.Resources; I don't intend to use it inside
I am designing a secure login with JSP. I intend to use Form Authorization
I have a class which I intend to use for performing calculations. I declare
I intend to develop an application using .Net 4.0, and intend to use EF4
The HLSL clip() function is described here . I intend to use this for

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.