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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T12:58:10+00:00 2026-05-28T12:58:10+00:00

I am working on a program and I am having an issue with three

  • 0

I am working on a program and I am having an issue with three of my buttons.
Here is the code for them:

panel.add(clearButton, c);
c.gridwidth = 1;
c.fill = GridBagConstraints.VERTICAL;
c.gridx = 1;
c.gridy = 4;
c.weighty = 1.0;

panel.add(addButton);
c.gridwidth = GridBagConstraints.VERTICAL;
c.gridx = 2;
c.gridy = 4;
c.weightx = 1.00;

panel.add(calcButton);
c.gridwidth = GridBagConstraints.VERTICAL;
c.gridx = 2;
c.gridy = 4;
c.weightx = 1.00;    

For some reason when the program runs, the clearbutton is not the same as the addButton and calcButton.

Can anyone help me on this? Here is the reference I am using: http://docs.oracle.com/javase/6/docs/api/java/awt/GridBagLayout.html

Please tell me if you need more info!

  • 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-28T12:58:11+00:00Added an answer on May 28, 2026 at 12:58 pm

    What is c? Why aren’t you using one when you add addButton and calcButton?

    Also, you don’t need to keep setting its fields to the same values.

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

Sidebar

Related Questions

Having successfully gotten a sample program working, I'm now starting to do Real Work
I'm working on a program for my C++ programming class, using wxWidgets. I'm having
I am working in Linux, Eclipse CDT, g++, with Boost library. Having existing program
I'm working on a program that processes many requests, none of them reaching more
I'm having a bit of trouble with a C++ program I'm working on. I've
I am having an issue with getting mod_rewrite rules working in .htaccess after moving
Hey stackoverflow community! I'm having an issue where a highly involved algorithmic program is
I'm having an issue with a small program that I wrote. It does what
I am working on Java RMI. I am having little issue with running my
I'm having an issue in my program in the part that I'm loading a

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.