I am trying to use the GridBagLayout in order to develop a windowed application.
Currently I am at a VERY early stage, just trying to add 3 components to a content pane. They should simply be displayed next to each other, in the top left of the frame, but they are being displayed in the centre of the window and I do not know why. Can anyone point me in the right direction.
Unfortuntely the FlowLayout will not be flexible enogh for the end application which requires multiple Components of various sizes, hence the dive into GridBagLayout.
I have read the tutorial and it has lead to more confusion.
The book I am reading states that values of GridBagLayout.weightx/y are between 0-100, the tutorial says between 0-1, although both could be considered a percentage weighting which is correct? Or are they both correct?
Stil having issues even when making the weightx/y non zero.
As the finished app will have mutilple components that need diffreent requirements I have decided to split the Componets into individual JPanels, but the initial test STILL puts the panel in the centre of the content pane, please help as I think I am going a bit mad.
Main Frame Class
Content Pane Class
I was her plaything! And so was this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss