65 lines
1.6 KiB
Java
65 lines
1.6 KiB
Java
package View;
|
|
|
|
import javax.swing.*;
|
|
import javax.swing.border.LineBorder;
|
|
import javax.swing.border.MatteBorder;
|
|
import javax.swing.border.TitledBorder;
|
|
import java.awt.*;
|
|
|
|
/**
|
|
* Implementierung verschiedener Algorithmen zur Berechnung von Ausgleichsgeraden.
|
|
*
|
|
* @Author: Armin Wolf
|
|
* @Email: a_wolf28@uni-muenster.de
|
|
* @Date: 02.06.2017.
|
|
*/
|
|
public class SidePanel extends JPanel {
|
|
|
|
|
|
private JLabel[] labels;
|
|
private JTextField[] text;
|
|
private JPanel continer;
|
|
private GridBagConstraints gbc;
|
|
|
|
public SidePanel(){
|
|
|
|
this.setBorder(new TitledBorder("Eingabefelder"));
|
|
this.labels = new JLabel[10];
|
|
this.text = new JTextField[10];
|
|
this.setLayout(new BorderLayout());
|
|
this.continer = new JPanel();
|
|
continer.setLayout(new GridBagLayout());;
|
|
gbc = new GridBagConstraints();
|
|
gbc.anchor = GridBagConstraints.NORTH;
|
|
gbc.fill = GridBagConstraints.HORIZONTAL;
|
|
|
|
|
|
addElement(0, "Konstante");
|
|
addElement(1, "Fehler");
|
|
addElement(2,"Quantile");
|
|
|
|
this.add(continer, BorderLayout.NORTH);
|
|
|
|
}
|
|
|
|
|
|
private void addElement(int row, String name){
|
|
this.labels[row] = new JLabel(name);
|
|
this.text[row] = new JTextField();
|
|
|
|
gbc.insets = new Insets(0, 5,0,0);
|
|
gbc.gridx = 0;
|
|
gbc.gridy = row;
|
|
gbc.weightx = 0.05;
|
|
gbc.weighty = 0.05;
|
|
continer.add(this.labels[row], gbc);
|
|
|
|
gbc.gridx = 1;
|
|
gbc.gridy = row;
|
|
gbc.weightx = 0.9;
|
|
gbc.weighty = 0.05;
|
|
gbc.insets = new Insets(0, 0,0,5);
|
|
continer.add(this.text[row], gbc);
|
|
}
|
|
}
|