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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:30:35+00:00 2026-06-12T16:30:35+00:00

So, this is my problem: I used the oracle documents as an example for

  • 0

So, this is my problem: I used the oracle documents as an example for my project, but when i run the program all it shows up as is a box with “weekly pay:” in the middle. What am I doing wrong?

JFrame window = new JFrame();
window.setTitle("Weekly Pay");
window.setSize(300, 150);
window.setResizable(false);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Color lGray = new Color(209, 209, 209);
GroupLayout layout = new GroupLayout(window);

JPanel panel = new JPanel();
panel.setBackground(lGray);
panel.setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);

JLabel id = new JLabel("ID Number");
JLabel hw = new JLabel("Hourly Wage");
JLabel rh = new JLabel("Regular Hours");
JLabel oh = new JLabel("Overtime Hours");
JButton calc = new JButton("Calculate");
JTextField idEntry = new JTextField(); //where the user imputs their ID
JTextField hwEntry = new JTextField(); //where the user imputs their hourly wage
JTextField rhEntry = new JTextField(); //where the user imputs their regular hours
JTextField ohEntry = new JTextField(); //where the user imputs their overtime hours
JLabel wp = new JLabel("Weekly Pay:");    

GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();    
hGroup.addGroup(layout.createParallelGroup().
  addComponent(id).addComponent(hw).addComponent(rh).addComponent(oh).addComponent(calc));
hGroup.addGroup(layout.createParallelGroup().
  addComponent(idEntry).addComponent(hwEntry).addComponent(rhEntry).addComponent(ohEntry).addComponent(wp));
layout.setHorizontalGroup(hGroup);

GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();    
vGroup.addGroup(layout.createParallelGroup(Alignment.BASELINE).
    addComponent(id).addComponent(idEntry));
vGroup.addGroup(layout.createParallelGroup(Alignment.BASELINE).
    addComponent(hw).addComponent(hwEntry));
vGroup.addGroup(layout.createParallelGroup(Alignment.BASELINE).
    addComponent(rh).addComponent(rhEntry));
vGroup.addGroup(layout.createParallelGroup(Alignment.BASELINE).
    addComponent(oh).addComponent(ohEntry));
vGroup.addGroup(layout.createParallelGroup(Alignment.BASELINE).
    addComponent(calc).addComponent(wp));
layout.setVerticalGroup(vGroup);

window.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-12T16:30:36+00:00Added an answer on June 12, 2026 at 4:30 pm

    There are two main problems: you set the group layout manager on the frame, not the panel, and you don’t actually put the panel onto the frame/window (since there is something in java UI programming called a window, I question the naming of the variable holding the frame to be ‘window’).

    Instead of “GroupLayout layout = new GroupLayout(window);”, use “GroupLayout layout = new GroupLayout(panel); // after panel is constructed, of course”.

    Then use “window.add(panel);” to put the panel in the frame/window; I would put this and “window.pack();” just before “window.setVisible(true);”

    rc

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

Sidebar

Related Questions

I have three tables being used for this problem: songs, blacklist, and whitelist. The
I've been working on this problem for a few hours and have used many
I've used this useful JQuery function that serializes nested elements. the problem is how
I tweaked this script that I used from JqueryUi and I have a problem.
I've got a problem concerning the javascript this keyword when used within a javascript
I have a problem when call applet method from javascript.. I used this function
This problem seems very simple to me, but I've been unable to fix it,
This problem has been bugging me for a long time. For example, the code
I have this Oracle table which is used to store application settings. This is
This problem is same as asked in here . Given a list of coins,

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.