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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:36:07+00:00 2026-05-31T12:36:07+00:00

I have a JDialog and inside it I have a JPanel that uses FlowLayout

  • 0

I have a JDialog and inside it I have a JPanel that uses FlowLayout

now I’ve created 3 labels and text fields using the Netbeans GUI Builder, and I want to add 2 more text fields using code

I’ve adjusted the size of the panel so that when I add a new label and a textfield with a preferred size the new set of label – textfield will be under the previous set

somewhere in the JDialog I do something like this

        JLabel cores = new JLabel("Cores");
        cores.setPreferredSize(new Dimension(70,15));
        first = new JTextField();
        first.setPreferredSize(new Dimension(140,20));
        JLabel power = new JLabel("Power");
        power.setPreferredSize(new Dimension(70,15));
        second = new JTextField();
        second.setPreferredSize(new Dimension(140,20));
        panel2.add(cores);panel2.add(first);panel2.add(power);panel2.add(second);

when I compile the program, the labels don’t show up and neither do the textfields

when I go down and click I have the following result

http://img684.imageshack.us/img684/13/unledlpy.png

if I type something, the text field appears

http://img5.imageshack.us/img5/6796/unledhig.png

the labels don’t appear though, I don’t think I made any changes to the properties, any help would be appreciated thanks

  • 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-31T12:36:08+00:00Added an answer on May 31, 2026 at 12:36 pm

    Define the no of columns while creating object.
    like this

    JTextField jt=new JTextField(20);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a JDialog in NetBeans and a custom constructor as follows: public
i have a jdialog with a jpanel inside it.I have jlabels(pictures) on the jpanel.How
In netbeans I have a JDialog with a JPanel component (called Keypad). I simply
I have created a JDialog which contains a JLabel. Because the length of text,
I have a JDialog dlg, created by a JFrame frm, that contains a JList
I have the following code that displays a JDialog , it shows a text
I have a jdialog and want close it on confirmation after that store the
I have been using this code to implement a Popup JDialog of sorts, like
I have a jDialog with a splitter inside it. One side has a tree
I have a GUI problem that I would like to get sorted out, but

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.