1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.JTextField;
public class JdevCVSConnection extends JPanel {
private GridBagLayout gridBagLayout1 = new GridBagLayout();
private JLabel methodeLabel = new JLabel();
private JComboBox methodComboBox = new JComboBox();
private JLabel userLabel = new JLabel();
private JTextField userTextField = new JTextField();
private JLabel portLabel = new JLabel();
private JTextField portTextField = new JTextField();
private JLabel hostLabel = new JLabel();
private JTextField hostTextField = new JTextField();
private JLabel repositoryLabel = new JLabel();
private JTextField repositoryTextField = new JTextField();
private JSeparator separator = new JSeparator();
private JPanel buttonsPanel = new JPanel();
private GridBagLayout gridBagLayout2 = new GridBagLayout();
private JButton okButton = new JButton();
private JButton cancelButton = new JButton();
public JdevCVSConnection() {
try {
jbInit();
} catch (Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
this.setLayout(gridBagLayout1);
this.setSize(new Dimension(412, 173));
methodeLabel.setText("Method:");
methodComboBox.setPreferredSize(new Dimension(200, 20));
userLabel.setText("User:");
portLabel.setText("Port:");
hostLabel.setText("Host :");
repositoryLabel.setText("Repository:");
buttonsPanel.setLayout(gridBagLayout2);
okButton.setText("Ok");
okButton.setPreferredSize(new Dimension(80, 22));
cancelButton.setText("Cancel");
cancelButton.setPreferredSize(new Dimension(80, 22));
this.add(methodeLabel,
new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
new Insets(15, 10, 0, 0), 0, 0));
this.add(methodComboBox,
new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE,
new Insets(15, 15, 0, 0), 0, 0));
this.add(userLabel,
new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
new Insets(5, 0, 0, 0), 0, 0));
this.add(userTextField,
new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
new Insets(5, 15, 0, 0), 0, 0));
this.add(portLabel,
new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE,
new Insets(5, 10, 0, 0), 0, 0));
this.add(portTextField,
new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
new Insets(5, 10, 0, 10), 0, 0));
this.add(hostLabel,
new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
new Insets(5, 0, 0, 0), 0, 0));
this.add(hostTextField,
new GridBagConstraints(1, 2, GridBagConstraints.REMAINDER,
1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
new Insets(5, 15, 0, 10), 0, 0));
this.add(repositoryLabel,
new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
new Insets(0, 10, 0, 0), 0, 0));
this.add(repositoryTextField,
new GridBagConstraints(1, 3, GridBagConstraints.REMAINDER,
1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
new Insets(5, 15, 0, 10), 0, 0));
this.add(separator,
new GridBagConstraints(0, 4, GridBagConstraints.REMAINDER,
1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
new Insets(5, 10, 5, 5), 0, 0));
buttonsPanel.add(okButton,
new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE,
new Insets(5, 0, 0, 5), 0, 0));
buttonsPanel.add(cancelButton,
new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,GridBagConstraints.NORTHEAST, GridBagConstraints.NONE,
new Insets(5, 0, 5, 10), 0,
0));
this.add(buttonsPanel,
new GridBagConstraints(0, 5, GridBagConstraints.REMAINDER, GridBagConstraints.REMAINDER,
1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 0), 0, 0));
}
} |
Partager