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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:40:49+00:00 2026-06-03T20:40:49+00:00

Even though it’s a valid method, JComboBox#setVisible doesn’t hide my JComboBox . Am I

  • 0

Even though it’s a valid method, JComboBox#setVisible doesn’t hide my JComboBox. Am I doing something wrong? If not, are there any alternatives?

  • 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-03T20:40:50+00:00Added an answer on June 3, 2026 at 8:40 pm

    Since you don’t show any interest in posting an SSCCE, here is mine showing that what you stated in question is false and nothing can be done until you post your code.

    This works fine for me ,

    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    
    public class FrameTest extends JFrame implements ActionListener {
    
        JComboBox test;
    
        public FrameTest() {
            setLayout(new FlowLayout());
            setSize(550, 100);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
            JButton hideJCombo = new JButton("Hide my JCombobox!");
            JButton showJCombo = new JButton("Show my JCombobox!");
    
            String course[] = {"This", "is", "a", "sample", "for", "StackOverflow"};
            test = new JComboBox(course);
    
            add(hideJCombo);
            add(test);
            add(showJCombo);
    
    
            hideJCombo.setActionCommand("hide");
            showJCombo.setActionCommand("show");
    
            hideJCombo.addActionListener(this);
            showJCombo.addActionListener(this);
    
        }
    
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
    
                @Override
                public void run() {
                    new FrameTest().setVisible(true);
    
                }
            });
        }
    
        @Override
        public void actionPerformed(ActionEvent e) {
    
            if ("hide".equals(e.getActionCommand())) {
                test.setVisible(false);
                System.out.println("hide");
            } else if ("show".equals(e.getActionCommand())) {
                test.setVisible(true);
            }
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Even though Lua does not differentiate between floating point numbers and integers, there are
Even though it's not part of HTTP 1.1/RFC2616 webapps that wish to force a
One would expect that even though strings are immutable, value-equality and reference-equality would not
Even though the API has been open since Mac OS X Leopard, there's surprisingly,
Note- even though im using phonegap, the question is not about some issue in
even though there are many examples out there, i can't find what I need?
Even though i know there are at least 2 or 3 topics with this
This is my case: Even though the command I run is not so relevant,
Even though I know that, at least to my knowledge, this is not the
There are times that the recByte will fail to receive response even though the

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.