-2

I want to adjust the column widths seperately. Not all having same width.

here's my code:

//columnModel.getColumn(0).setPreferredWidth(100);
    table = new JTable();
    table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
    table.setMinimumSize(new Dimension(6, 0));
    table.setMaximumSize(new Dimension(9, 0));
    table.setIntercellSpacing(new Dimension(9, 1));
    table.setRowMargin(10);
    table.setBackground(new Color(153, 255, 153));
    table.setFont(new Font("Segoe UI Semibold", Font.BOLD, 17));
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.addMouseListener(new MouseAdapter() {

here's what it looks like:

my table

  • 1
    I hope that this data is masked, random data. – Kain0_0 Jan 11 at 4:45

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.