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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:47:25+00:00 2026-05-25T23:47:25+00:00

I have a JFrame . I have added menu-bar to it. I have set

  • 0

I have a JFrame.
I have added menu-bar to it.
I have set its size and location using following line.

frmMain.setBounds(0, 0, 1024, 768);  // JFrame 

Next I have added a JInternalFrame to the code for JInternalFrame as follows:

ifActivateProject=new JInternalFrame();
ifActivateProject.setBounds(450, 400, 300, 350);
ifActivateProject.add(pnlActivateProject);
ifActivteProject.setVisible(true);
ifActivateProject.setDefaultCloseOperation(JInternalFrame.DO_NOTHING_ON_CLOSE);
frmMain.getContentPane().add(ifActivateProject);

When I executes the program the Internal frame occupies all the remaining area in JFrame. As I have set the location and size of internal frame. It wont appear at that location and of the specified size.

I want to show Internal frame of different sizes depending on menu click means on one menu click one internal frame has shown. After closing that internal frame on another menu click another should be appear in my JFrame. All these internal frames are of different sizes. But the problem is the added internal frame as shown in above code snippet acquires all the space of JFrame.

What’s wrong with above code?

  • 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-25T23:47:26+00:00Added an answer on May 25, 2026 at 11:47 pm

    A JInternalFrrame should be added to a JDesktopPane, not a JFrame.

    See How to Use Internal Frames for more details.

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

Sidebar

Related Questions

I have a simple drawing program, I set my Jframe's size with the following
I would like my entire JFrame to vertically scroll. I have added the following
I have a JFrame with a CardLayout set as its layout manager. This has
I have created jframe in which jpanels are added dynamically what i can't do
I have a JFrame(frm) in which I've added a JPanel (pnl1)..which in turn has
I have a JFrame with 1 panel for drawing and set KyeListener for JFrame.
I have JPanel has already added to JFrame. And I have dynamically added JPanel.
I have a strange problem... I have a JFrame and added two JInternalFrame I
Scenario: I have one JFrame and JPanel added to that JFrame . on this
i've added a title to my Jframe, and now its blocked everything else, what

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.