Skip to Main Content

Java Programming

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to set an image as background using Java on Netbeans

807589Nov 14 2008 — edited Nov 16 2008
Hi Expert,
I am a newbies in java and i am trying to creat an image as a background on a GUI i created, but i am not getting any image dispalying as bacground.
Here is my code:
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class NewClass1 extends javax.swing.JFrame {
    public NewClass1() {
        initComponents();
            ImageIcon image = new ImageIcon("C:\\myimage.jpg");
		JLabel background = new JLabel(image);
		background.setBounds(0, 0, image.getIconWidth(), image.getIconHeight());
		getLayeredPane().add(background, new Integer(Integer.MIN_VALUE));
		JPanel panel = new JPanel();
                panel.add(background);
                //panel.add(getLayeredPane);
		panel.setOpaque(false);
		setContentPane( panel );
    }
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                NewClass1 JFrame = new NewClass1();
                JFrame.setVisible(true);
                JFrame.setBounds(20, 20, 600, 400);
                JFrame.setDefaultCloseOperation(NewClass1.EXIT_ON_CLOSE);
		JFrame.setSize(200, 689);
            }
        });
    }

    private void initComponents() {
        throw new UnsupportedOperationException("Not yet implemented");
    }
}
Can some check to see why i am not getting an image. If possible modify my code to give me the correct one that can get the image.
Thanks

Edited by: m_l on Nov 14, 2008 7:29 AM

Edited by: m_l on Nov 14, 2008 7:30 AM

Comments

StephenBaker

Your illustration shows how to mirror the data of rpool (the boot pool) but does not mention of replicating the boot block on the mirrored boot disks.    Oracle provides documentation for this: https://support.oracle.com/epmos/faces/DocumentDisplay?id=1020196.1.  The end of the article explains the differences between Solaris 10/11 and SPARC/x86

Alexandre Borges

Your illustration shows how to mirror the data of rpool (the boot pool) but does not mention of replicating the boot block on the mirrored boot disks.    Oracle provides documentation for this: https://support.oracle.com/epmos/faces/DocumentDisplay?id=1020196.1.  The end of the article explains the differences between Solaris 10/11 and SPARC/x86

Stephen

Good evening. First, I'm sorry for delay to answer, but I was very sick and hospitalized.

About the article, you are right. When I sent the article to Oracle, I skipped this part because I sent a previous version of article. That's my fault. I'm working on a fix and I'll be updating it soon. I'm sorry for mistake.

Have a nice day and thanks for your message.

Akexandre.

user13149047

Hello ,

Can I have any ACE contributions related to Solaris Cluster 4.3 ?

Please suggest me with the link where I can find it

-Thanks,

Chowdary

1055392

Hi,

My experience with ZFS is  the mirror is not working like in ufs. ZFS mirror disks can be boot from primary disk and mirror boot disk (secondary) if the mirror is not broken. otherwise wont' work.

zfs Mirror is useful only when any of the disk failed (among disk1 ann disk2). I asked this question in all seminar and training session that why broken zfs mirror is not working like in ufs. No one know the correct answer and reason.

you can update here if any one know.

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 14 2008
Added on Nov 14 2008
24 comments
4,970 views