make sliders fill entire available space

pull/53/head
Zlatin Balevsky 2020-10-09 18:17:44 +01:00
parent a8cbb1ad05
commit d4a5f238c5
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package com.muwire.gui.wizard
import java.awt.BorderLayout
import java.awt.GridBagConstraints
import static com.muwire.gui.Translator.trans
@ -24,21 +25,23 @@ class TunnelStep extends WizardStep {
gridBagLayout()
panel (border : titledBorder(title : trans("SPEED_VS_ANONYMITY"), border : etchedBorder(), titlePosition: TitledBorder.TOP,
constraints : gbc(gridx: 0, gridy: 0, fill : GridBagConstraints.HORIZONTAL, weightx : 100))) {
borderLayout()
def lengthTable = new Hashtable()
lengthTable.put(1, new JLabel(trans("MAX_SPEED")))
lengthTable.put(3, new JLabel(trans("MAX_ANONYMITY")))
tunnelLengthSlider = slider(minimum : 1, maximum : 3, value : defaults.tunnelLength,
majorTickSpacing : 1, snapToTicks: true, paintTicks: true, labelTable : lengthTable,
paintLabels : true)
paintLabels : true, constraints : BorderLayout.CENTER)
}
panel (border : titledBorder(title : trans("RELIABILITY_VS_RESOURCES"), border : etchedBorder(), titlePosition: TitledBorder.TOP,
constraints : gbc(gridx: 0, gridy: 1, fill : GridBagConstraints.HORIZONTAL, weightx : 100))) {
borderLayout()
def quantityTable = new Hashtable()
quantityTable.put(1, new JLabel(trans("MIN_RESOURCES")))
quantityTable.put(6, new JLabel(trans("MAX_RELIABILITY")))
tunnelQuantitySlider = slider(minimum : 1, maximum : 6, value : defaults.tunnelQuantity,
majorTickSpacing : 1, snapToTicks : true, paintTicks: true, labelTable : quantityTable,
paintLabels : true)
paintLabels : true, constraints : BorderLayout.CENTER)
}
panel(constraints : gbc(gridx:0, gridy: 2, weighty: 100))
}