Here you can find the source of makeTransparant(JTable table, JScrollPane scrollPane)
public static void makeTransparant(JTable table, JScrollPane scrollPane)
//package com.java2s; //License from project: Open Source License import javax.swing.JComponent; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.DefaultTableCellRenderer; public class Main { public static void makeTransparant(JTable table, JScrollPane scrollPane) { table.setOpaque(false);/*from www . j av a 2 s . c om*/ ((DefaultTableCellRenderer) table.getDefaultRenderer(Object.class)).setOpaque(false); ((DefaultTableCellRenderer) table.getDefaultRenderer(String.class)).setOpaque(false); ((JComponent) table.getDefaultRenderer(Boolean.class)).setOpaque(false); scrollPane.setOpaque(false); scrollPane.getViewport().setOpaque(false); } }