自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Oracle Java程序添加背景圖片的操作方案

數(shù)據(jù)庫 Oracle
我們今天主要向大家介紹的是Oracle Java的相關(guān)的實(shí)際應(yīng)用程序添加漂亮的背景圖片的實(shí)際操作,以下就是正文的相關(guān)內(nèi)容的描述。

以下的文章主要是對(duì)Oracle Java的相關(guān)的實(shí)際應(yīng)用程序添加漂亮的背景圖片的實(shí)際操作的描述,其在整理之后可執(zhí)行的相關(guān)實(shí)際應(yīng)用代碼如下:希望本文章會(huì)給你在其實(shí)際應(yīng)用方面帶來一些幫助在此方面。

 

  1. import java.awt.*;  
  2. import javax.swing.*;  
  3. public class TestBackgroundColor extends JFrame  
  4. {  
  5. public static void main(String[] args)  
  6. {  
  7.  TODO Auto-generated method stub  
  8. TestBackgroundColor tbc = new TestBackgroundColor();  
  9. tbc.setVisible(true);  
  10. }  
  11. private JPanel imagePanel;  
  12. private ImageIcon background;  
  13. public TestBackgroundColor()  
  14. {  
  15. background = new ImageIcon("漸變背景14.png");  

 

背景圖片

 

  1. JLabel label = new JLabel(background); 

把背景圖片顯示在一個(gè)標(biāo)簽里面

把標(biāo)簽的大小位置設(shè)置為圖片剛好填充整個(gè)面板

 

  1. label.setBounds(0,0,background.getIconWidth(),background.getIconHeight()); 

把內(nèi)容窗格轉(zhuǎn)化為JPanel,否則不能用方法setOpaque()來使內(nèi)容窗格透明

 

  1. imagePanel = (JPanel)this.getContentPane();  
  2. imagePanel.setOpaque(false);  

 

內(nèi)容窗格默認(rèn)的布局管理器為BorderLayout

 

  1. imagePanel.setLayout(new FlowLayout());  
  2. imagePanel.add(new JButton("測(cè)試按鈕"));  
  3. this.getLayeredPane().setLayout(null);  

 

把背景圖片添加到分層窗格的最底層作為背景

 

  1. this.getLayeredPane().add(label,new Integer(Integer.MIN_VALUE));  
  2. this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
  3. this.setSize(background.getIconWidth(),background.getIconHeight());  
  4. this.setVisible(true);  
  5. }  
  6. }  

 

以上的相關(guān)內(nèi)容就是對(duì)為Oracle Java程序添加漂亮背景圖片的介紹,望你能有所收獲。

【編輯推薦】

  1. Oracle ebs的oaf開發(fā)環(huán)境進(jìn)行正確的配置
  2. Oracle reports功不可沒,實(shí)現(xiàn)報(bào)表定長(zhǎng)輸出
  3. 查看Oracle當(dāng)前連接數(shù)的具體方案
  4. 加速Oracle大批量數(shù)據(jù)處理的2個(gè)好用方案
  5. Oracle遞歸條件查詢的操作流程
責(zé)任編輯:佚名 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2010-08-26 10:26:44

CSS

2010-09-09 14:38:05

CSS背景圖片

2011-09-01 15:16:00

Ubuntu

2010-10-13 08:57:06

Visual Stud

2010-08-18 13:27:15

CSS兼容IE6

2009-03-19 08:54:15

Windows 7定制登陸界面

2011-08-18 17:24:34

iPhone開發(fā)UINavigatio

2011-08-08 15:48:13

iPhone TableView 背景

2020-12-16 07:29:23

Windows10操作系統(tǒng)動(dòng)態(tài)鎖屏

2010-11-23 10:51:45

UI交互設(shè)計(jì)產(chǎn)品管理

2020-02-17 13:45:27

抓取代碼工具

2010-04-12 14:44:06

Oracle Impd

2010-09-03 14:00:29

CSSbackground

2023-12-10 14:39:25

刪除圖片開源圖片背景移除

2011-08-29 17:58:19

Ubuntu

2011-06-03 14:04:11

Android

2011-06-20 17:17:11

Qt Widget QWidget

2010-04-16 09:52:40

Oracle JOB

2010-04-07 09:09:49

Oracle查詢

2010-04-12 13:05:56

Oracle軟件
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)