Avatar of ANISHKA1
ANISHKA1Flag for United States of America

asked on 

Need Assistance for setiing GridBagConstraints

I have Jdialog where ihave to add following components alike this

-----------------------------------------------------------------------------|

Label1                      Combobox1

Label2                       TextBox1


 OkBtn                             CancleBtn


-----------------------------------------------------------------------------|

I tried but not get expected result.I need assistance for it...Thanks
GridBagLayout TgridBag = new GridBagLayout();
                  Tpanel.setLayout(TgridBag);
                  I_MPNPoolNameCombo = new JComboBox();
                  Tpanel.add(new JLabel("Select the pool name:"),
                                   new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0,
                                                          GridBagConstraints.EAST,
                                                          GridBagConstraints.NONE,
                                                          new Insets(0, 5, 5, 0), 0, 0));
                  Tpanel.add(I_MPNPoolNameCombo, new GridBagConstraints(1, 2, 1, 1, 1.0, 1.0,
                                                          GridBagConstraints.WEST,
                                                          GridBagConstraints.NONE,
                                                          new Insets(0, 5, 5, 5), 0, 0));

                 
                  I_staticIpAddressTextField = new JTextField(10);
                  queryModes();
                  Tpanel.add(new JLabel("Static IP address(Optional):"),
                                   new GridBagConstraints(0, 4, 1, 1, 1.0, 1.0,
                                                          GridBagConstraints.EAST,
                                                          GridBagConstraints.NONE,
                                                          new Insets(0, 5, 5, 0), 0, 0));
                  Tpanel.add(I_staticIpAddressTextField, new GridBagConstraints(1, 4, 1, 1, 1.0, 1.0,
                                                          GridBagConstraints.WEST,
                                                          GridBagConstraints.NONE,
                                                          new Insets(0, 5, 5, 5), 0, 0));
Java

Avatar of undefined
Last Comment
ANISHKA1
ASKER CERTIFIED SOLUTION
Avatar of SprudeVI
SprudeVI
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of ANISHKA1
ANISHKA1
Flag of United States of America image

ASKER

Accepted
Avatar of ANISHKA1
ANISHKA1
Flag of United States of America image

ASKER

Thanks
Java
Java

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.

102K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo