Exemple #1
0
 // labels
 public void initLabels() {
   int w = 90;
   int h = 20;
   for (int i = 0; i < labels.length; i++) {
     if (i == 0) {
       labels[i] = new JLabel(labels_text[i]);
       labels[i].setBounds(0, 20, w, h);
       haut.add(labels[i]);
     } else if (i < 2) {
       labels[i] = new JLabel(labels_text[i]);
       labels[i].setBounds(0, labels[i - 1].getY() + 30, w, h);
       haut.add(labels[i]);
     } else {
       if (i == 2) {
         labels[i] = new JLabel(labels_text[i]);
         labels[i].setBounds(milieu.getX() - 10, milieu.getY() - 70, w, h);
       } else if (i == 7) {
         labels[i] = new JLabel(labels_text[i]);
         labels[i].setBounds(labels[i - 1].getX(), labels[i - 1].getY() + 75, w, h);
       } else {
         labels[i] = new JLabel(labels_text[i]);
         labels[i].setBounds(labels[i - 1].getX(), labels[i - 1].getY() + 30, w, h);
       }
       milieu.add(labels[i]);
     }
   }
 }
Exemple #2
0
 // initialize panneau du millieu
 public void initPanneauMillieu() {
   final int X = PADDING_X + 10;
   final int LARG_PANNEAU_MILLEU = LARG_FENETRE - (2 * X);
   final int HAUT_PANNEAU_MILLEU = 300;
   milieu.setLayout(null);
   milieu.setBounds(X, haut.getY() + haut.getHeight(), LARG_PANNEAU_MILLEU, HAUT_PANNEAU_MILLEU);
   milieu.setBorder(new LineBorder(GRIS_FONCE, 2));
 }
Exemple #3
0
  // initialize panneau du bas
  public void initPanneauBas() {
    final int X = PADDING_X + 10;
    final int LARG_PANNEAU_BAS = LARG_FENETRE - (2 * X);
    final int HAUT_PANNEAU_BAS =
        HAUT_FENETRE - haut.getHeight() - milieu.getHeight() - PADDING_Y - 50;
    final int VGAP = HAUT_PANNEAU_BAS / 2;

    FlowLayout flowlayout = new FlowLayout();
    flowlayout.setVgap(VGAP);

    bas.setLayout(flowlayout);
    bas.setBounds(X, milieu.getY() + milieu.getHeight(), LARG_PANNEAU_BAS, HAUT_PANNEAU_BAS);
  }
Exemple #4
0
  private void initializeComponents() {
    this.setTitle("Synchro - Kopierassistent");
    this.setBounds(0, 0, 550, 600);

    this.setResizable(true);
    this.setLayout(null);
    this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    this.addWindowListener(this);

    mainPanel = new JPanel();
    mainPanel.setBounds(0, 0, this.getWidth() - 20, 25);
    // fcPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
    mainPanel.setLayout(null);

    btnBackup = new JButton("Backup");
    btnBackup.setBounds(this.getWidth() / 2, 0, this.getWidth() / 2 - 20, mainPanel.getHeight());
    btnBackup.addActionListener(this);
    mainPanel.add(btnBackup);

    this.add(mainPanel);

    fcPanel = new JPanel();
    fcPanel.setBounds(10, 40, this.getWidth(), 260);
    // fcPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
    fcPanel.setLayout(null);

    quellLabel = new JLabel("Bitte Quellverzeichnis auswählen");
    quellLabel.setBounds(10, 5, 320, 20);
    fcPanel.add(quellLabel);

    quellListModel = new DefaultListModel<>();
    quellJList = new JList<ListItem>(quellListModel);
    quellJList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    quellJList.setLayoutOrientation(JList.VERTICAL);
    quellJList.addListSelectionListener(this);

    listBoxScroller = new JScrollPane(quellJList);
    listBoxScroller.setBounds(0, 30, 315, 100);
    fcPanel.add(listBoxScroller);

    btnQAuswahl = new JButton("Quellverz. hinzufügen");
    btnQAuswahl.setBounds(320, 30, 200, 25);
    btnQAuswahl.addActionListener(this);
    fcPanel.add(btnQAuswahl);
    btnQEntfernen = new JButton("Quellverz. entfernen");
    btnQEntfernen.setBounds(320, 60, 200, 25);
    btnQEntfernen.addActionListener(this);
    fcPanel.add(btnQEntfernen);

    zielLabel = new JLabel("Bitte Zielverzeichnis auswählen");
    zielLabel.setBounds(10, 135, 320, 20);
    fcPanel.add(zielLabel);

    zielListModel = new DefaultListModel<>();
    zielJList = new JList<ListItem>(zielListModel);
    zielJList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    zielJList.setLayoutOrientation(JList.VERTICAL);
    zielJList.addListSelectionListener(this);

    listBoxScroller2 = new JScrollPane(zielJList);
    listBoxScroller2.setBounds(0, 160, 315, 100);
    fcPanel.add(listBoxScroller2);

    btnZAuswahl = new JButton("Zielverz. hinzufügen");
    btnZAuswahl.setBounds(320, 160, 200, 25);
    btnZAuswahl.addActionListener(this);
    fcPanel.add(btnZAuswahl);
    btnZEntfernen = new JButton("Zielverz. entfernen");
    btnZEntfernen.setBounds(320, 190, 200, 25);
    btnZEntfernen.addActionListener(this);
    fcPanel.add(btnZEntfernen);
    this.add(fcPanel);

    ButtonGroup bGrp = new ButtonGroup();

    optionPanel = new JPanel();
    optionPanel.setBounds(10, 300 + 10, this.getWidth() - 40, 90);
    optionPanel.setPreferredSize(new Dimension(this.getWidth() - 40, 90));
    // optionPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
    optionPanel.setLayout(new GridLayout(3, 1));

    nUebSchr = new JRadioButton("Keine Dateien überschreiben");
    nUebSchr.addItemListener(this);
    bGrp.add(nUebSchr);
    optionPanel.add(nUebSchr);

    ueSchr = new JRadioButton("Neuere Dateien überschreiben");
    ueSchr.addItemListener(this);
    bGrp.add(ueSchr);
    optionPanel.add(ueSchr);

    aUeSchr = new JRadioButton("Alle Dateien überschreiben");
    aUeSchr.addItemListener(this);
    bGrp.add(aUeSchr);
    optionPanel.add(aUeSchr);

    this.add(optionPanel);

    syncPanel = new JPanel();
    syncPanel.setBounds(
        10, optionPanel.getY() + optionPanel.getHeight() + 10, this.getWidth() - 30, 25);
    // syncPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
    syncPanel.setLayout(new BorderLayout());

    btnSync = new JButton("Sync it!");
    btnSync.setBounds(0, 0, 150, (syncPanel.getHeight() / 3));
    btnSync.addActionListener(this);
    btnSync.setPreferredSize(new Dimension(150, (syncPanel.getHeight() / 3)));
    btnSync.setMaximumSize(new Dimension(150, (syncPanel.getHeight() / 3)));
    syncPanel.add(btnSync, BorderLayout.LINE_START);

    btnAbbruch = new JButton("Abbrechen");
    btnAbbruch.setBounds(0, 0, 150, (syncPanel.getHeight() / 3));
    btnAbbruch.addActionListener(this);
    btnAbbruch.setPreferredSize(new Dimension(150, (syncPanel.getHeight() / 3)));
    btnAbbruch.setMaximumSize(new Dimension(150, (syncPanel.getHeight() / 3)));
    btnAbbruch.setVisible(false);
    syncPanel.add(btnAbbruch, BorderLayout.LINE_END);

    progressBar = new JProgressBar(JProgressBar.HORIZONTAL);
    progressBar.setBorderPainted(true);
    progressBar.setPreferredSize(new Dimension(300, (syncPanel.getHeight() / 3)));
    progressBar.setForeground(Color.RED);
    progressBar.setStringPainted(true);
    progressBar.setVisible(true);
    syncPanel.add(progressBar, BorderLayout.CENTER);
    this.add(syncPanel);

    logPanel = new JPanel();
    logPanel.setBounds(
        10, syncPanel.getY() + syncPanel.getHeight() + 10, this.getWidth() - 30, 105);
    logPanel.setLayout(new BorderLayout());

    textArea = new JTextArea();
    textArea.setMargin(new Insets(3, 3, 3, 3));
    textArea.setBackground(Color.black);
    textArea.setForeground(Color.LIGHT_GRAY);
    textArea.setAutoscrolls(true);
    textArea.setFocusable(false);
    textAreaScroller = new JScrollPane(textArea);
    DefaultCaret caret = (DefaultCaret) textArea.getCaret();
    caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
    textAreaScroller.setBounds(0, 0, syncPanel.getWidth(), 50);

    logPanel.add(textAreaScroller, BorderLayout.CENTER);
    this.add(logPanel, BorderLayout.SOUTH);
  }