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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:58:07+00:00 2026-06-13T08:58:07+00:00

Help me! Whenever I try to start up the code below, it shows only

  • 0

Help me! Whenever I try to start up the code below, it shows only the button on the bottom and the password field everywhere else. I want to be able to see everything, but I can’t

public void setup(){
    frame = new JFrame("Votinator 3000");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    voteconfirm = new JLabel("");
    textarea = new JTextField(1);
    submit = new JButton("Submit Vote!");
    chooser = new JList(items);
    password = new JPasswordField(1);
    password.setVisible(true);
    choices = new JComboBox();
    choices.addItem("Choose");
    choices.addItem("Submit Own");
    type = new JPanel();
    type.add(textarea);
    choices.setEditable(false);
    choices.setSelectedIndex(0);
    frame.setBounds(300, 300, 400, 400);
    frame.getContentPane().add(type);
    frame.getContentPane().add(choices);
    frame.getContentPane().add(voteconfirm);
    frame.getContentPane().add(chooser);
    frame.getContentPane().add(textarea);
    frame.getContentPane().add(password,BorderLayout.CENTER);
    frame.getContentPane().add(submit,BorderLayout.SOUTH);
    frame.setVisible(true);
}
  • 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-13T08:58:08+00:00Added an answer on June 13, 2026 at 8:58 am

    This

    frame.getContentPane().add(password,BorderLayout.CENTER);
    

    Will replace anything else you’ve added to your screen…

    This, will add the button to the bottom of the screen…

    frame.getContentPane().add(submit,BorderLayout.SOUTH);
    

    You could change the layout to a FlowLayout, that will display everything…

    enter image description here

    frame.setLayout(new FlowLayout());
    frame.setBounds(300, 300, 400, 400);
    frame.getContentPane().add(type);
    frame.getContentPane().add(choices);
    frame.getContentPane().add(voteconfirm);
    frame.getContentPane().add(chooser);
    frame.getContentPane().add(textarea);
    frame.getContentPane().add(password);
    frame.getContentPane().add(submit);
    

    But I hardly think that’s what you really want.

    Take a read through

    • A Visual Guide to Layout Managers
    • Using Layout Managers

    And see if you can find one or more layouts that suit your requirements

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

Sidebar

Related Questions

Whenever I try to run this code: #Open file f = open(i.txt, r) line
Whenever I try to add drop down code to my Menu link i.e About,
Need a help again. Whenever I try to run any svn command from command
I need help with auto-saving a textarea. Basically, whenever a user is typing in
Help me translate following block of the Haskell code. The run function produces text
I get an error whenever I try to create a simple edge from a
whenever I try to install a new magento extension through Magento Connnect I am
Whenever i try to send a mail from my website for email verification, the
I am going to start of by showing the code I have thus far:
Whenever I try to build my iPhone app in Xcode 3.2.1 I get an

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.