第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

java中插入背景圖片為什么總是覆蓋掉按鈕啊

java中插入背景圖片為什么總是覆蓋掉按鈕啊

Bubblegirl 2016-06-28 11:23:33
主函數(shù):public static void main(String[] args) { MsClient client=new MsClient("聊天進(jìn)擊~(yú)",410,100,400,500,95,158,160); JFrame.setDefaultLookAndFeelDecorated(true); ? ?client.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//設(shè)置點(diǎn)關(guān)閉能夠關(guān)閉面板的命令 client.addBkImage("G:/歡喜/小象與兔子/23.jpg", -10,-10,400,500, 1); client.setLayout(null); ?? client.setVisible(true); } 加的按鈕是這些 public void addAllBtn(){ this.addBtn(container,"選風(fēng)格~", new BackgroundActionListener(container,"G:/歡喜/貓咪/23.jpg"), 150,40); this.addBtn(container,"清新", new BackgroundActionListener(container,"G:/歡喜/貓咪/22.jpg"), 100,330); this.addBtn(container,"極簡(jiǎn)", new BackgroundActionListener(container,"G:/機(jī)智的李承穎/歡喜/清新/09.jpg"), 250,330); }這是我插入背景調(diào)用的函數(shù):public void addBkImage(String path,int x,int y,int w,int h,int index){//"G:/機(jī)智的李承穎/歡喜/貓咪/23.jpg" System.out.println("添加背景"); ImageIcon img = new ImageIcon(path);//這是背景圖片 ?? ? ? JLabel imgLabel = new JLabel(img);//將背景圖放在標(biāo)簽里。 ? ? imgLabel.setBounds(x,y,w,h); ? ? ((JComponent)this.getContentPane()).setOpaque(false); ? ? //將該面板設(shè)置為透明,這樣就能顯示出背景圖片出來(lái)了。 ? ? this.add(imgLabel, index); ? ? //注意這里是關(guān)鍵,將背景標(biāo)簽添加到client的 ?LayeredPane面板里。 ? ? container.setLayout(null);? container.setVisible(true); ? ? }
查看完整描述

1 回答

?
Caballarii

TA貢獻(xiàn)1123條經(jīng)驗(yàn) 獲得超629個(gè)贊

雖然我不會(huì),但我猜先addBkImage再addAllBtn有可能有用

查看完整回答
反對(duì) 回復(fù) 2016-06-28
  • 1 回答
  • 0 關(guān)注
  • 5352 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)