㈠ Java swing 窗體如何設置背景圖片
background=newImageIcon("images/backImage.png");
backImage=newJLabel(background);
backImage.setBounds(0,0,background.getIconWidth(),
background.getIconHeight());
backPanel=(JPanel)this.getContentPane();
backPanel.setOpaque(false);
this.getLayeredPane().setLayout(null);
this.getLayeredPane().add(backImage,newInteger(Integer.MIN_VALUE));
backPanel.setLayout(newBorderLayout());
這個是我程序裡面復制出來的,效果就下面圖一樣。
㈡ 怎麼設置table欄背景圖片
table{
background-image:url("1.jpg");
}
設置背景圖片的樣式,然後添加圖片的路徑就可以了。