K
K
Kamikaze10242017-12-20 13:14:33
css
Kamikaze1024, 2017-12-20 13:14:33

How to add regular expressions to a java table?

I want to add input filtering to some of the table rows. I heard that you can screw regular expressions to it, but how to do it?

public void drawConfigTable(ArrayList<ArrayList<String>> config) {
        configFieldTypes = new Vector<>();
        configTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);

        //заполнить массивы полей и значений
        Vector<String> columns = new Vector<>();

        columns.add("Name");
        columns.add("Value");

        Object[] colArr = columns.toArray();
        DefaultTableModel tableModel = new DefaultTableModel(colArr, 0);

        try {
            for (int i = 0; i < config.size(); i++) {
                Vector<String> row = new Vector<>();
                row.add(config.get(i).get(0));
                String changedEncode = config.get(i).get(2);
                row.add(changedEncode);
                configFieldTypes.add(config.get(i).get(1));
                tableModel.addRow(row);
            }
        } catch (Exception e) {
            System.out.println(e.toString());
        }

        //рисовать таблицу
        configTable.setModel(tableModel);
        configTable.setAutoscrolls(true);
        configTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

        JScrollPane scroll = new JScrollPane(configTable,
                ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);

        additionalFrame = new JFrame("PagingTableModel");
        additionalFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        additionalFrame.setContentPane(scroll);
        additionalFrame.setBounds(30, 50, 1300, 600);
        additionalFrame.setVisible(true);

        saveDataBase.setEnabled(true);
        getConfigButton.setEnabled(false);
        laStatus.setText("Простаивает");
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
igumenov, 2019-10-14
@igumenov

You need to make transform: translateX(-200px)
200- menu width
make the menu itself always visible,
for example position: absolute; top:0; left: 100%
Then by shifting body_wrap we can see the menu

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question