【 透明的 JTable 如何做?】 你试试这个函数看看。JTable myTable = new JTable();myTable.setOpaque(false); //这个函数是设置控件不透明。你查一查API看看嘛。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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 ); }} 虽然我要的是 JTable 的透明, 算了 只有20份凑合吧 如何保证数独解的唯一性啊? int如何转换double型? 手机不支持jar格式文件 JAVA中append与concat 关于String的replaceAll方法??? 请问如何获得ResultSet的行数? 创建对象放在方法里面/外面,或者方法for里面/外面,有什么区别 java鼠标事件问题(急急急) 能帮帮我吗,关于以后的路怎么走? 一个简单例子:关于java线程对象的销毁问题, 非常困惑! 【JButton 在 Windows 风格下的默认边框是什么?】 再一次要疯了。。。。。。
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 ); }
}