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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:32:57+00:00 2026-05-11T21:32:57+00:00

Background information: I am implementing a visual diagram editor, which consists of different complex

  • 0

Background information:

I am implementing a visual diagram editor, which consists of

  • different complex elements (re-sizable, with title bar, sub-elements) and
  • different simple elements (not re-sizable, no title bar, no sub-elements).

All elements are draggable.

I am using JInternalFrame (for complex elements) along with JPanel
(for simple elements) to represent elements of a schematic diagram. There is a container (either a JDesktopPane or a JLayeredPane), which contain
all these elements.

I have several problems with this concept:

Case 1 – The container is a JDesktopPane:

  • JInternalFrames are always above other elements.
  • Clicking other elements don’t “deactivate” previously active JInternalFrame

Case 2 – The container is a JLayeredPane:

  • After clicking some elements inside a JInternalFrame, it stays
    “activated” forever.

Case 3 – JInternalFrame used for everything, but without decoration for simple elements:

  • My custom border (which is needed when I manually remove
    JInternalFrame’s title bar)
    is every time replaced by current LAF border, after
    activating/deactivating the JInternalFrame.

I don’t get the whole concepts behind activating JInternalFrames anyway.
If I could make a JInternalFrame not activable at all, I could
choose Case 2 any would be happy.

Please advice me, what would be an simple and straightforward solution to given problems.

NOTE: Selection of components and activation of JInternalFrame
seem to be different things.

  • 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-11T21:32:58+00:00Added an answer on May 11, 2026 at 9:32 pm

    I might misunderstand your problem. Have you tried to look at the setSelected() method of JIF? It seems there are support for method override and vetoable activation events.

    Edit: Maybe we have some terminological misunderstanding as the javadoc states:

    /**
     * Selects or deselects the internal frame
     * if it's showing.
     * A <code>JInternalFrame</code> normally draws its title bar
     * differently if it is
     * the selected frame, which indicates to the user that this
     * internal frame has the focus.
     * When this method changes the state of the internal frame
     * from deselected to selected, it fires an
     * <code>InternalFrameEvent.INTERNAL_FRAME_ACTIVATED</code> event.
     * If the change is from selected to deselected,
     * an <code>InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED</code> event
     * is fired.
     *
     * @param selected  a boolean, where <code>true</code> means this internal frame
     *                  should become selected (currently active)
     *                  and <code>false</code> means it should become deselected
     * @exception PropertyVetoException when the attempt to set the
     *            property is vetoed by the <code>JInternalFrame</code>
     *
     * @see #isShowing
     * @see InternalFrameEvent#INTERNAL_FRAME_ACTIVATED
     * @see InternalFrameEvent#INTERNAL_FRAME_DEACTIVATED
     *
     * @beaninfo
     *     constrained: true
     *           bound: true
     *     description: Indicates whether this internal frame is currently
     *                  the active frame.
     */
    

    Edit 2: Now I re-read your 2nd case. I would say each JIF has its own separated focus/selection environment. You could create a method which traverses all your JIFs and deselects anything in it unless its the component you wanted to be selected.

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

Sidebar

Related Questions

As usual, some background information first: Database A (Access database) - Holds a table
And if you do, can you give some background information on the implementation and
Background: I have a little video playing app with a UI inspired by the
Background: At my company we are developing a bunch applications that are using the
Background: Some time ago, I built a system for recording and categorizing application crashes
Background: I need to reserve an amount of memory below 0xA0000 prior to my
Background I am writing and using a very simple CGI-based (Perl) content management tool
Background I have a massive db for a SharePoint site collection. It is 130GB
Background I am trying to create a copy of a business object I have
Background: Over the next month, I'll be giving three talks about or at least

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.