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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:29:32+00:00 2026-06-10T21:29:32+00:00

I’m planning on combining JMenu and JCheckBoxMenuItem so I can have: (1) a popup

  • 0

I’m planning on combining JMenu and JCheckBoxMenuItem so I can have:
(1) a popup menu containing instances of this new component.
(2) this new component would have a check box on the left as well as being able to expand to the right and show other sub-menus (like a regular JMenu)

I had a couple questions:

First, am I reinventing the wheel? / Has this been done before?

Second, I’m trying to figure out how swing knows how to get the UI class for the extended Component class? (I see that JMenu for example has a String uiClassID member that’s somehow used for that, but it’s not the exact class name… I debugged it to a HashTable lookup in UIDefaults)

  • 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-06-10T21:29:34+00:00Added an answer on June 10, 2026 at 9:29 pm
    1. I think it would be confusing for the users to see a JMenu with a check box (if I understand correctly, you want to put this thing directly in a JMenuBar). I don’t think this has been done very often before, and there is a reason for that 🙂

    2. The UI class that is used depends on the actual look and feel. See the subclasses of javax.swing.plaf.MenuItemUI

    The full story about the Swing architecture is described here: http://java.sun.com/products/jfc/tsc/articles/architecture/

    A look-and-feel implementation provides concrete subclasses for each
    abstract plaf UI class. For example, the Windows look-and-feel defines
    WindowsButtonUI, a WindowsScrollBarUI, and so on. When a component
    installs its UI delegate, it must have a way to look up the
    appropriate concrete class name for the current default look-and-feel
    dynamically. This operation is performed using a hash table in which
    the key is defined programmatically by the getUIClassID() method in
    the component. The convention is to use the plaf abstract class name
    for these keys.

    EDIT: if you want to put this in a popup menu, note that JPopupMenu is a JComponent, therefore you can put anything there, including normal JCheckBoxes. An example is here: http://www.javarichclient.com/do-more-with-jpopupmenu/

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
Does anyone know how can I replace this 2 symbol below from the string
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.