Replies To: JAVA'S GUI

Re: JAVA'S GUI

Posted 30 April 2007 - 05:25 AM

Firstly, are you going to be using a GUI builder like Netbeans or you are going to use Layoutmanagers?
Also, the rules at this forum is that you do something first then seek specific help, not the other way round.

Re: JAVA'S GUI

Posted 30 April 2007 - 06:51 PM

gyron, on 30 Apr, 2007 - 08:25 AM, said:

Firstly, are you going to be using a GUI builder like Netbeans or you are going to use Layoutmanagers?
Also, the rules at this forum is that you do something first then seek specific help, not the other way round.

Please be more specific about your question. Example, post an image of the GUI of somthing similar and we will be able to help you out. To get you started about GUI's, see my tutorials in the Java Tutorials section, you will find for sure plenty of useful information there.

Re: JAVA'S GUI

Posted 02 May 2007 - 03:20 AM

alpha02, on 30 Apr, 2007 - 06:51 PM, said:

gyron, on 30 Apr, 2007 - 08:25 AM, said:

Firstly, are you going to be using a GUI builder like Netbeans or you are going to use Layoutmanagers?
Also, the rules at this forum is that you do something first then seek specific help, not the other way round.

Please be more specific about your question. Example, post an image of the GUI of somthing similar and we will be able to help you out. To get you started about GUI's, see my tutorials in the Java Tutorials section, you will find for sure plenty of useful information there.

Re: JAVA'S GUI

Posted 02 May 2007 - 05:29 PM

khumbza, on 2 May, 2007 - 06:20 AM, said:

alpha02, on 30 Apr, 2007 - 06:51 PM, said:

gyron, on 30 Apr, 2007 - 08:25 AM, said:

Firstly, are you going to be using a GUI builder like Netbeans or you are going to use Layoutmanagers?
Also, the rules at this forum is that you do something first then seek specific help, not the other way round.

Please be more specific about your question. Example, post an image of the GUI of somthing similar and we will be able to help you out. To get you started about GUI's, see my tutorials in the Java Tutorials section, you will find for sure plenty of useful information there.

i 'm using layoutmanegers.

Well the GridBagLayout or the null layout are commonly used layouts, but I don't know much about GridBagLayout. so why not try the null layout? Follow my tutorial and I'm sure you will be able to write a GUI. You must understand the basics of Java (classes, objects, methods, variables...) to be able to follow the tutorial.

Re: JAVA'S GUI

Posted 02 May 2007 - 07:04 PM

gridbag is the best way to go, it takes some time to learn all the properties, but it adjusts to all resizings as opposed to the rigidness of null, and can take on properties of alignment found in grid layout.

Re: JAVA'S GUI

Posted 03 May 2007 - 12:29 AM

I've used GridBag a lot because it can do anythign with one layout, but sometimes it can overcomplicate things and tempt you to put different logical units into one big mess. Usually mixing simple layouts is the easiest way to go, and they help you separate different aspects of a GUI better, thus makes rearranging easier.
The new SpringLayout is another good way, because in difficulity it is in the middle, I've used it a couple of times, too.
Anyway, it all depends on what you are trying to achieve. If you can show us a sketch of your desired interface, I think we can give you better suggestions on what to use.

Re: JAVA'S GUI

Posted 03 May 2007 - 12:22 PM

I always use the null layout, but I once tried the grid bag one and all components were sticked together, so I find it easier to create complex GUIs with the null one. Can you really create complex GUis with grid bag?

Re: JAVA'S GUI

Posted 04 May 2007 - 12:39 AM

alpha02, on 3 May, 2007 - 12:22 PM, said:

Can you really create complex GUis with grid bag?

Very much so! It can get as complex as one desires. YOur components got muddled up in the centre most likely because you were not correctly implementing the GridBagConstraints. One needs to properly master the use of these constraints because they are just what makes the GridBagLayout tick.
Once i started using this layout, i gave up drag and drop!
Try it and have fun.

Re: JAVA'S GUI

Posted 04 May 2007 - 09:22 AM

gyron, on 4 May, 2007 - 03:39 AM, said:

alpha02, on 3 May, 2007 - 12:22 PM, said:

Can you really create complex GUis with grid bag?

Very much so! It can get as complex as one desires. YOur components got muddled up in the centre most likely because you were not correctly implementing the GridBagConstraints. One needs to properly master the use of these constraints because they are just what makes the GridBagLayout tick.
Once i started using this layout, i gave up drag and drop!
Try it and have fun.

Well the components are all stuck at the center of my panel, and I cannot create a GUI with space between components... I cannot set the exact position of each component like the null layout does, anyway the best layout is the one you like best

Re: JAVA'S GUI

Posted 06 May 2007 - 04:37 PM

Well, I could still debate it, because with the usage of borders and maybe spacing components it is possible, but as I wrote earlier I am not an advocate of gridbag layout, and I recommend using more containers with simple layouts...
Anyway, you are right, if the goal is pixel-precise positioning within a container that has a fixed dimension, then the null layout is the way to go (but if localization and dynamic labels are concerned, it can become quickly impossible to test due to varying text lengths and size). However most GUIs are today expected to fill the whole window that can be stretched to different sizes, and this is quite cumbersome to achieve with null layout.