Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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);
        ((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);
    }
}