This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
H4X0RZ's profile picture

Java Layout [Question]

Started by H4X0RZ, 02 June 2013 - 11:04 AM
H4X0RZ #1
Posted 02 June 2013 - 01:04 PM
Hello com,
I know that this isn't lua but I don't where else I can ask.

My question:
I've started programing java and tried out swing today.
Now, when I add the elements into my JFrame, they are unsorted etc.
How do I use the Layout (for example GridBagLayout) to "sort"nthe elements?

Thx for your time
-Freack100-
Yevano #2
Posted 02 June 2013 - 01:19 PM
I haven't used Swing all that much, and never used GridBagLayout, but a quick Google search found this link: http://docs.oracle.c...ut/gridbag.html. Basically just create a pane with GridBagLayout object and create a GridBagContraints, set your options, then add the component to a pane with the constraints as the second arg to the add method.