Author |
Message |
Nai

|
Posted: Sun Apr 17, 2011 9:39 pm Post subject: Sizing the component a GUI |
|
|
I have to make a GUI program to play the game of Mastermind. I don't think it will be too difficult to actually code the game part of it, but I'm struggling to get the game's GUI to show up with the correct dimensions.
I'm fairly new at GUI programming, so if anyone could give me any tips on how to get this to the correct dimensions it would be greatly apprieciated.
(I'm trying to make the GUI from IMastermind match the one from the sample -- See attached files) |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Nai

|
Posted: Mon Apr 18, 2011 10:26 pm Post subject: RE:Sizing the component a GUI |
|
|
Ok never mind, I managed to get the right sort of layout kind of working with border layouts and an assortment of other things - I don't like Java GUI's very much right now.. |
|
|
|
|
 |
SmokeMonster
|
Posted: Tue Apr 19, 2011 2:52 am Post subject: Re: Sizing the component a GUI |
|
|
Coding GUIs by hand is a waste of time and hard to get exactly right. Just use a WYSIWYG guibuilder tool. Netbeans comes with a really solid guibuilder try that, better to spend your time writing real code rather than hacking around by hand trying too glue up a gui to make it look exactly as you want. |
|
|
|
|
 |
Nai

|
Posted: Fri Apr 22, 2011 7:18 pm Post subject: RE:Sizing the component a GUI |
|
|
Ok, thanks I'll definitely try that if I ever want to make another GUI. Only thing is is that with assignment I don't think my teacher would have appreciated me using a shortcut for half the assignment  |
|
|
|
|
 |
deltamanx

|
Posted: Mon Apr 25, 2011 9:02 pm Post subject: Re: Sizing the component a GUI |
|
|
You could always set the layout of the container to Absolute (setLayout(null))
But that way you have you manually specify component sizes and XY location.
(Which maybe be both a plus and a minus). |
|
|
|
|
 |
|