Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to set image in JDesktopPane

843806Feb 29 2008
how can i set the images as background in JDesktopPane in another folder
JDesktopPane desktop=new JDesktopPane;
JLabel background =new JLabel();
background.setPreferredSize(new Dimension(800,700));
background.setBounds(inset, inset,
screenSize.width - inset*8,
screenSize.height - inset*18);
background.setIcon(new javax.swing.ImageIcon("fullscreen.jpg"));
desktop = new JDesktopPane(); 
desktop.add(background); 
setContentPane(desktop);
setJMenuBar(createMenuBar());
This code is setting the "fullscreen.jpg" image in the JDesktopPane, the image is in the project folder, but what i need is i have created a folder "images" in the src folder and put all the images in the folder. how can i set the images folder that contains images in the JDesktopPane..

Thanks in Advance ..
Help me plz
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 28 2008
Added on Feb 29 2008
0 comments
489 views