Beispiel #1
0
 private void init_tbl_chats() {
   tbl_chats_ALM = new ArrayListModel();
   tbl_chats_M = new TblchatsModel(tbl_chats_ALM);
   tbl_chats.setModel(tbl_chats_M);
   tbl_chats.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
   int[] tbl_widths_chats = {58, 100, 0, 0, 0};
   for (int i = 0, n = tbl_widths_chats.length; i < n; i++) {
     if (i == 1) {
       continue;
     }
     TableWidthUtilities.setColumnWidth(tbl_chats, i, tbl_widths_chats[i]);
   }
   Dimension d = tbl_chats.getTableHeader().getPreferredSize();
   d.height = 0;
   tbl_chats.getTableHeader().setPreferredSize(d);
   tbl_chats.getTableHeader().setFont(new java.awt.Font("Arial", 0, 12));
   tbl_chats.setRowHeight(65);
   tbl_chats.setFont(new java.awt.Font("Arial", 0, 12));
   tbl_chats.getColumnModel().getColumn(0).setCellRenderer(new TableRender.set2());
   tbl_chats.getColumnModel().getColumn(1).setCellRenderer(new TableRender.set3());
   tbl_chats.getTableHeader().setResizingAllowed(true);
   tbl_chats.setShowGrid(false);
   tbl_chats.setShowHorizontalLines(true);
   tbl_chats.setShowVerticalLines(false);
   tbl_chats.getColumnModel().getColumn(1).setCellRenderer(new Html());
 }
 private void init_tbl_delivery_trucks() {
   tbl_delivery_trucks_ALM = new ArrayListModel();
   tbl_delivery_trucks_M = new Tbldelivery_trucksModel(tbl_delivery_trucks_ALM);
   tbl_delivery_trucks.getTableHeader().setPreferredSize(new Dimension(100, 40));
   tbl_delivery_trucks.setModel(tbl_delivery_trucks_M);
   tbl_delivery_trucks.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
   tbl_delivery_trucks.setRowHeight(25);
   int[] tbl_widths_delivery_trucks = {100, 100, 0};
   for (int i = 0, n = tbl_widths_delivery_trucks.length; i < n; i++) {
     if (i == 1) {
       continue;
     }
     TableWidthUtilities.setColumnWidth(tbl_delivery_trucks, i, tbl_widths_delivery_trucks[i]);
   }
   Dimension d = tbl_delivery_trucks.getTableHeader().getPreferredSize();
   d.height = 25;
   tbl_delivery_trucks.getTableHeader().setPreferredSize(d);
   tbl_delivery_trucks.getTableHeader().setFont(new java.awt.Font("Arial", 0, 11));
   tbl_delivery_trucks.setRowHeight(35);
   tbl_delivery_trucks.setFont(new java.awt.Font("Arial", 0, 11));
 }
Beispiel #3
0
  public static void setModel(
      JTable tbl, Object[][] obj, String[] col_names, int[] tbl_widths_customers1) {
    tbl.setModel(
        new javax.swing.table.DefaultTableModel(obj, col_names) {

          boolean[] canEdit = new boolean[] {false, false, false, false, false, false};

          @Override
          public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
          }
        });
    int[] tbl_widths_customers = tbl_widths_customers1;
    for (int i = 0, n = tbl_widths_customers.length; i < n; i++) {
      if (i == 1) {
        continue;
      }
      TableWidthUtilities.setColumnWidth(tbl, i, tbl_widths_customers[i]);
    }
    tbl.setRowHeight(30);
    tbl.setFont(new java.awt.Font("Arial", 0, 11));
  }
 public static void init_tbl_disbursement_categories(JTable tbl_disbursement_categories) {
   tbl_disbursement_categories_ALM = new ArrayListModel();
   tbl_disbursement_categories_M =
       new Tbldisbursement_categoriesModel(tbl_disbursement_categories_ALM);
   tbl_disbursement_categories.setModel(tbl_disbursement_categories_M);
   tbl_disbursement_categories.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
   tbl_disbursement_categories.setRowHeight(25);
   int[] tbl_widths_disbursement_categories = {100, 0};
   for (int i = 0, n = tbl_widths_disbursement_categories.length; i < n; i++) {
     if (i == 0) {
       continue;
     }
     TableWidthUtilities.setColumnWidth(
         tbl_disbursement_categories, i, tbl_widths_disbursement_categories[i]);
   }
   Dimension d = tbl_disbursement_categories.getTableHeader().getPreferredSize();
   d.height = 25;
   tbl_disbursement_categories.getTableHeader().setPreferredSize(d);
   tbl_disbursement_categories.getTableHeader().setFont(new java.awt.Font("Arial", 0, 12));
   tbl_disbursement_categories.setRowHeight(25);
   tbl_disbursement_categories.setFont(new java.awt.Font("Arial", 0, 12));
 }
  private void init_tbl_charges() {
    tbl_charges_ALM = new ArrayListModel();
    tbl_charges_M = new TblchargesModel(tbl_charges_ALM);

    tbl_charges.setModel(tbl_charges_M);
    tbl_charges.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
    tbl_charges.setRowHeight(25);

    //        tbl_charges.setAutoResizeMode(0);
    int[] tbl_widths_accounts = {0, 0, 200, 150};

    for (int i = 0, n = tbl_widths_accounts.length; i < n; i++) {
      if (i == 2) {
        continue;
      }
      TableWidthUtilities.setColumnWidth(tbl_charges, i, tbl_widths_accounts[i]);
      //          TableWidthUtilities.
      //          TableWidthUtilities.
    }

    tbl_charges.getTableHeader().setFont(new java.awt.Font("Arial", Font.BOLD, 10));
    tbl_charges.setRowHeight(35);
    tbl_charges.setFont(new java.awt.Font("Arial", 1, 10));
  }
  private void init_tbl_baptism() {
    tbl_employee_payroll_ALM = new ArrayListModel();
    tbl_employee_payroll_M = new TblInvoicesModel(tbl_employee_payroll_ALM);

    tbl_cust.setModel(tbl_employee_payroll_M);
    tbl_cust.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
    tbl_cust.setRowHeight(25);

    //        tbl_cust.setAutoResizeMode(0);
    int[] tbl_widths_accounts = {450, 0, 100, 100};

    for (int i = 0, n = tbl_widths_accounts.length; i < n; i++) {
      if (i == 0) {
        continue;
      }
      TableWidthUtilities.setColumnWidth(tbl_cust, i, tbl_widths_accounts[i]);
      //          TableWidthUtilities.
      //          TableWidthUtilities.
    }

    tbl_cust.getTableHeader().setFont(new java.awt.Font("Arial", Font.BOLD, 12));
    tbl_cust.setRowHeight(50);
    tbl_cust.setFont(new java.awt.Font("Arial", 1, 12));
  }