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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:10:39+00:00 2026-05-21T16:10:39+00:00

Right, I have a JTabbedPane that has a JPanel that contains a JLabel and

  • 0

Right, I have a JTabbedPane that has a JPanel that contains a JLabel and a JTextField.

my code

JTabbed Pane declaration :

        this.tabPane = new JTabbedPane();
    this.tabPane.setSize(750, 50);
    this.tabPane.setLocation(10, 10);
        tabPane.setSize(750,450);
    tabPane.add("ControlPanel",controlPanel);

textfield declaration :

    this.channelTxtFld = new JTextField("");
    this.channelTxtFld.setFont(this.indentedFont);
    this.channelTxtFld.setSize(200, 30);
    this.channelTxtFld.setLocation(200, 10);

JLabel :
this.channelLabel = new JLabel(“Channel name : “);
this.channelLabel.setSize(150, 30);
this.channelLabel.setLocation(10,10);

private void createPanels() {
    controlPanel = new JPanel();
    controlPanel.setSize(650,500);
}
 private void fillPanels() {
    controlPanel.add(channelLabel);
    controlPanel.add(channelTxtFld);

}

So what my plan is, was to have a tabbed pane that has a JPanel where I have some Labels, textfields and buttons on fixed positions, but after doing this this is my result:

https://i.stack.imgur.com/vXa68.png

What I wanted was that I had the JLabel and next to it a full grown JTextfield on the left side not in the middle.

Anyone any idea what my mistake is ?

thank you 🙂

  • 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-21T16:10:40+00:00Added an answer on May 21, 2026 at 4:10 pm

    What kind of Layout Manager are you using for your controlPanel, you probably want BorderLayout, putting the Label in the West, and the TextField in the center.

    BTW, setting the size and position of various components doesn’t make sense unless you are using a Null Layout, which isn’t a good idea. So i’d remove all that stuff and let the Layout Manager do it for you.

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

Sidebar

Related Questions

I hope I can explain this right I have two input fields that require
I have right now this code: <ul><li class=listitem>text<li></ul> jQuery: $('.listitem').click(function() { $(#elname).text($(this).text()); $('#slists').css('visibility','hidden') $('#elname').css('visibility','visible')
This is the code I have right now with jQuery. 1.fiddle. What I want
I have this JDialog with a JTabbedPane: I just want to add a JLabel
Right I have a main layout defined, that has a frame, a table in
This is what I have right now: ^[0-9]([,][0-9])?$ My problem is that i want
The code I have right now looks like this: NSString *path = @/Users/student/Desktop/conf.txt NSArray
What I have right now is an animation that starts when I press space:
This is what I have right now for a file residing on the same
Right now I have a script that will get the last five files in

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.