Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
jvx:client:gui:layoutmanager [2018/02/01 12:24]
admin
jvx:client:gui:layoutmanager [2018/02/01 12:47]
admin
Line 15: Line 15:
 FlowLayout offers the vertical and horizontal alignment of components, the use of margins, and it allows stretching as well as control of the alignment of the components within the layout. It basically supplements //​java.awt.FlowLayout//​ with additional functionality. FlowLayout offers the vertical and horizontal alignment of components, the use of margins, and it allows stretching as well as control of the alignment of the components within the layout. It basically supplements //​java.awt.FlowLayout//​ with additional functionality.
  
-== FormLayout ==+==== FormLayout ​====
  
 As we can guess from the name, this layout manager is used for the creation of forms. However, it can also be used for a variety of other tasks. The basic idea behind this layout manager was to enable the creation of complex forms without using nesting or complexity. As we can guess from the name, this layout manager is used for the creation of forms. However, it can also be used for a variety of other tasks. The basic idea behind this layout manager was to enable the creation of complex forms without using nesting or complexity.
Line 23: Line 23:
 This allows, for example, subdividing a panel in table form, such as the //​java.awt.GridLayout//​. In addition, it can also be viewed as the //​java.awtGridBagLayout//,​ without the corresponding level of complexity. This allows, for example, subdividing a panel in table form, such as the //​java.awt.GridLayout//​. In addition, it can also be viewed as the //​java.awtGridBagLayout//,​ without the corresponding level of complexity.
  
-The following examples illustrate the use of layout managers:+The following examples illustrate the use of layout managers
 + 
 +=== Simple example ===
  
 A form containing 2 columns (default setting): A form containing 2 columns (default setting):
Line 53: Line 55:
 </​file>​ </​file>​
  
-The following call is sufficient to create 4 columns:+The following call:
  
 <file java> <file java>
 layout.setNewlineCount(4);​ layout.setNewlineCount(4);​
-</​file>​+</​file> ​ 
 + 
 +is sufficient to create 4 columns: 
 + 
 +{{:​jvx:​client:​gui:​form_4cols.png?​nolink|}}  
 + 
 +=== Complex example ===
  
-{{:​jvx:​client:​gui:​form_4cols.png?​nolink|}} 
 A somewhat more complex GUI is shown below: A somewhat more complex GUI is shown below:
  
Line 103: Line 110:
 gpanDedails.add(edtTown,​ flDetails.getConstraints(5,​ 7, -1, 7)); gpanDedails.add(edtTown,​ flDetails.getConstraints(5,​ 7, -1, 7));
 </​file>​ </​file>​
 +
 +=== Error dialog ===
  
 As a final example we want to show the framework´s error message, this time using a direct anchor: As a final example we want to show the framework´s error message, this time using a direct anchor:
Line 136: Line 145:
                                               getLeftAnchor(),​ -5)));                                               getLeftAnchor(),​ -5)));
 </​file>​ </​file>​
 +\\ 
 +**<fs 20px>​Hint</​fs>​**
 +
 +There'​s a demo application which allows to inspect the anchors of the FormLayout. The source code is [[https://​github.com/​sibvisions/​jvx.formlayout-visualization|hosted on github]].
 +
 +{{https://​github.com/​sibvisions/​jvx.formlayout-visualization/​raw/​master/​screenshots/​formlayout-visualization.png?​nolink}}
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information