コード例 #1
0
  private JPanel getForm() {
    try {

      //                                1     2    3    4    5      1       2    3   4  5
      FormLayout lay =
          new FormLayout("0dlu,10dlu,fill:0:grow(1.0),10dlu,0dlu", "10dlu,100dlu,5dlu,p,5dlu");
      PanelBuilder pb = new PanelBuilder(lay);
      pb.getPanel().setOpaque(false);
      CellConstraints cc = new CellConstraints();
      atblm = new MyArztTableModel();
      atblm.setColumnIdentifiers(
          new String[] {"Drucken", "Name", "Vorname", "Strasse", "Ort", "LANR", "BSNR", ""});
      arzttbl = new JXTable(atblm);
      arzttbl.getColumn(0).setMaxWidth(30);
      arzttbl.getColumn(7).setMinWidth(0);
      arzttbl.getColumn(7).setMaxWidth(0);
      arzttbl.validate();
      JScrollPane jscr = JCompTools.getTransparentScrollPane(arzttbl);
      jscr.validate();
      pb.add(jscr, cc.xy(3, 2, CellConstraints.FILL, CellConstraints.DEFAULT));

      FormLayout lay2 =
          new FormLayout(
              "fill:0:grow(0.33),150dlu,fill:0:grow(0.33),150dlu,fill:0:grow(0.33)", "5dlu,p,5dlu");
      PanelBuilder pb2 = new PanelBuilder(lay2);
      pb2.getPanel().setOpaque(false);
      CellConstraints cc2 = new CellConstraints();
      buts[0] = new JButton("Auswahl übernehmen");
      buts[0].setActionCommand("uebernehmen");
      buts[0].addActionListener(this);
      pb2.add(buts[0], cc2.xy(2, 2));

      buts[1] = new JButton("neuen Arzt aufnehmen");
      buts[1].setActionCommand("zusatz");
      buts[1].addActionListener(this);
      pb2.add(buts[1], cc2.xy(4, 2));

      pb2.getPanel().validate();

      pb.add(pb2.getPanel(), cc.xy(3, 4));

      pb.getPanel().validate();

      new SwingWorker<Void, Void>() {
        @Override
        protected Void doInBackground() throws Exception {
          try {
            ladeTabelle();
            Reha.thisClass.progressStarten(false);
          } catch (Exception ex) {
            ex.printStackTrace();
          }
          return null;
        }
      }.execute();

      return pb.getPanel();
    } catch (Exception ex) {
      ex.printStackTrace();
    }
    return null;
  }