New to Java; GUI?s
Posted on 2001-06-13
I'm new to Java and have a couple questions and RFC regarding laying out components. I'm currently using JBuilder 3.5.
1) What is the preferred method (or approach) for laying out components in a JFrame assuming one has a complex layout? For clarity I'll offer a simple example:
Suppose I want to construct a layout with four components: two JLables and two JTextAreas. Each JLable is to be followed by a JTextArea on its own line and centered similar to the following:
Hand coding this I could get something remotely similar to this by creating a content pane with a 2X1 GridLayout, insert two JPanels and add JLable1/JtextArea1 to JPanel1 and add JLable2/JtextArea2 to JPanel2. However the line spacing is going to change if the user sizes the JFrame. Not ideal.
2) JBuilder doesn't facilitate (in design mode) creating a content pane and putting two pannels inside it. Rather it always creates the first panel then puts all subsequent panels inside the first. I'm wondering if there is a reason for this?
It doesn't seem to me that Swing has any easy method to layout components having positional & aspect integrity that is independent of scale. It seems what is needed is a vector based approach similar to that which Macromedia flash uses.
Finally I'm interested in finding someone who knows JBuilder to tutor me remotely via real time web meeting/desktop sharing. Please add comment if interested.