ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
setLayout(gridbag);
/*Set the Bold CheckBox */
buildConstraints(constraints,0,0,1,1,10,10); //? Afou einai void pos epireazei tin constraints
constraints.fill=GridBagConstraints.EAST;
gridbag.setConstraints(BoldCheck,constraints);
add(BoldCheck);
/*Set the Colors */
buildConstraints(constraints,1,0,1,1,10,10);
constraints.fill=GridBagConstraints.NONE;
gridbag.setConstraints(Colors,constraints);
Colors.add("Add the Colors");
add(Colors);
/*Set the Italic Checkbox */
buildConstraints(constraints,2,0,1,1,10,10);
constraints.fill=GridBagConstraints.WEST;
gridbag.setConstraints(ItalicCheck,constraints);
add(ItalicCheck);
/*Set the Text Area */
buildConstraints(constraints,0,1,3,1,10,10);
constraints.fill=GridBagConstraints.WEST;
gridbag.setConstraints(WriteText,constraints);
add(WriteText);
/*Set the Red Scroll Bar */
buildConstraints(constraints,0,2,3,1,30,10);
constraints.fill=GridBagConstraints.NONE;
gridbag.setConstraints(Red,constraints);
add(Red);
/*Set the Blue Scroll Bar */
buildConstraints(constraints,0,3,6,1,30,10);
constraints.fill=GridBagConstraints.NONE;
gridbag.setConstraints(Blue,constraints);
add(Blue);
/*Set the Green Scroll Bar */
buildConstraints(constraints,0,4,3,1,30,10);
constraints.fill=GridBagConstraints.NONE;
gridbag.setConstraints(Green,constraints);
add(Green);
/*Set the Font Choice */
buildConstraints(constraints,0,5,1,1,30,10);
constraints.fill=GridBagConstraints.NONE;
gridbag.setConstraints(Fonts,constraints);
for (int i=0;i<FontNames.length;i++)
Fonts.add(FontNames[i]);
add(Fonts);
/*Set the Size Choice */
buildConstraints(constraints,2,5,2,1,30,10);
constraints.fill=GridBagConstraints.NONE;
gridbag.setConstraints(Size,constraints);
for (int i=5;i<25;i++)
Size.add(String.valueOf(i));
add(Size);
I try to find out why my 3 scrollbars appear in so small size
Have a nice day
IMHO, java's gui stuff is really difficult to program with, (especially when
you need stuff in an exact position in the windo).
but you might try increasing the gridwidth of the scroll bar (the 4th arg
of your function) although this could make things look strange.
you can also try the setPrefferedSize() method for the scroll bar objects.
i have found that this method usually works.
the thing is, those grid bag properties effect how the element is distributed
relative to the grid, but i don't think they effect the pixel size of the element itself.
Can you post the whole code? We can't tell what kinds of components these are.
Edit: Also, increasing the number of cells gives more control over how big things are (make bigger stuff span multiple cells)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.