Tudo bem Lucas, eu tentei o que você mandou e ainda assim não deu certo. Segue abaixo o código do JTable
tableTasks = new JTable();
tableTasks.setToolTipText("");
tableTasks.setGridColor(new Color(255, 255, 255));
tableTasks.setRowHeight(40);
tableTasks.setSelectionBackground(new Color(5, 224, 115));
tableTasks.setModel(new DefaultTableModel(
new Object[][] {
{"nom1", "desc", "notasdaskj", Boolean.TRUE},
{null, "", null, null},
{"", null, null, null},
{"", null, null, null},
{null, null, null, null},
},
new String[] {
"Nome", "Descri\u00E7\u00E3o", "Notas", "Tarefa Conclu\u00EDda"
}
) {
Class[] columnTypes = new Class[] {
String.class, String.class, String.class, Boolean.class
};
public Class getColumnClass(int columnIndex) {
return columnTypes[columnIndex];
}
boolean[] columnEditables = new boolean[] {
false, false, false, true
};
public boolean isCellEditable(int row, int column) {
return columnEditables[column];
}
});
tableTasks.setBackground(new Color(4, 168, 87));
tableTasks.setForeground(new Color(255, 255, 255));
tableTasks.setFont(new Font("Segoe UI", Font.PLAIN, 14));
tableTasks.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
GroupLayout gl_mainPanel2 = new GroupLayout(mainPanel2);
gl_mainPanel2.setHorizontalGroup(
gl_mainPanel2.createParallelGroup(Alignment.LEADING)
.addGroup(gl_mainPanel2.createSequentialGroup()
.addContainerGap()
.addComponent(tableTasks, GroupLayout.PREFERRED_SIZE, 447, GroupLayout.PREFERRED_SIZE)
.addGap(36)
.addComponent(projetoVazioPanel, GroupLayout.PREFERRED_SIZE, 293, GroupLayout.PREFERRED_SIZE))
);
gl_mainPanel2.setVerticalGroup(
gl_mainPanel2.createParallelGroup(Alignment.LEADING)
.addGroup(gl_mainPanel2.createSequentialGroup()
.addGroup(gl_mainPanel2.createParallelGroup(Alignment.TRAILING)
.addGroup(gl_mainPanel2.createSequentialGroup()
.addContainerGap()
.addComponent(tableTasks, GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addGroup(Alignment.LEADING, gl_mainPanel2.createSequentialGroup()
.addGap(347)
.addComponent(projetoVazioPanel, GroupLayout.PREFERRED_SIZE, 215, GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
mainPanel2.setLayout(gl_mainPanel2);
Obs: “mainPanel2” é o painel onde o JTable está