你试试这个函数看看。JTable myTable = new JTable();
myTable.setOpaque(false);      //这个函数是设置控件不透明。
你查一查API看看嘛。

解决方案 »

  1.   

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import common.Transfer;public class BackgroundImage extends JFrame {            public BackgroundImage(){
                      try
                      {
                            this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);                        ImageIcon icon = Transfer.getAppIcon("resource/me.gif");
                            JLabel label = new JLabel(icon);                        JPanel c = (JPanel)this.getContentPane();
                            c.setLayout(null);
                            JButton btnTest = new JButton("test");
                            btnTest.setBounds(0,0,50,20);
                            c.add(btnTest);
                            c.setOpaque(false);                        label.setBounds(0, 0, 700, 500);
                            this.getLayeredPane().add(label, new Integer(Integer.MIN_VALUE));
                      }
                      catch(Exception e)
                      {
                            e.printStackTrace();
                      }
                }
                public static void main(String[] args){
                            BackgroundImage frame = new BackgroundImage();
                            frame.setSize( 700, 500 );
                            frame.setVisible( true );            }
    }
      

  2.   

    虽然我要的是 JTable 的透明, 算了 只有20份凑合吧