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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:13:06+00:00 2026-05-31T06:13:06+00:00

When a particular button is clicked I want another set of buttons to be

  • 0

When a particular button is clicked I want another set of buttons to be added to the Panel, however at the moment when I do this, I can add them as many times as I want, I need this to be only possible once. Would the best way to do this be set the adding of the buttons and fields in a while loop?

   if(e.getSource() == selectScript){

                while(scriptB < 1 ){
                imageID = new JTextField("INT");
                imageDescription = new JTextField("imgDescription");
                imagePath = new JTextField("imagePath");
                manageImageTab.add(imageID);
                manageImageTab.add(imageDescription);
                manageImageTab.add(imagePath);
                insertImage = new JButton("Add an Image");
                insertImage.addActionListener(new dbaccess());
                manageImageTab.add(insertImage);

                manageImageTab.revalidate();
                validate();
                scriptB++;

                }
}
  • 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-31T06:13:07+00:00Added an answer on May 31, 2026 at 6:13 am

    Perhaps rather than add and remove the JButtons, you could add the buttons once at the code start, just don’t make them visible until you need them, or perhaps better place them all on a JPanel that is not visible and then made visible when desired. Just don’t forget to call revalidate() and repaint() on the container that holds the buttons and their panel.

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

Sidebar

Related Questions

how can hide particular button which is created from UIBarButtonItem in iphone ?
how can i use a particular UIActionSheet's button with some actioning (explain in brief)
I trying to set separate style for particular widgets, like for one button with
In my app, when one particular image button is clicked and held, i must
I want to replace a particular string in #TextArea1 . This happens when a
It's possible to specify a particular function to be called when button is clicked
How to disable a button after entering a particular letter in a textfield?
In particular, is this possible with Javascript? >> Version 1.2.3.4.match(/\S+ (\d+)(\.\d+)*/) [Version 1.2.3.4, 1,
In particular, I am adding a compass to my app. I want to place
In particular: I want to replace all occurances of a full stop \. with

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.