Background pic on my jframe

Hi,
kindly direct me how to put up a personal image as the background for the main app window!..
Am pasting a a small part of the affected code.
I just need to be pointed to the right direction!
Thanks a ton
Ankur
     public Main()     {
            super("HmmJ v1.0");
            ismainopen=true;
            systray();
        //Make the big window be indented 50 pixels from each edge
        //of the screen.
        int inset = 40;
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setBounds(inset, inset,
                  screenSize.width  - inset*3,
                  screenSize.height - 100);
        //Set up the GUI.
        desktop = new JDesktopPane(); //a specialized layered pane
        //createFrame(); //create first "window"
        setContentPane(desktop);
        setJMenuBar(createMenuBar());
        //Make dragging a little faster but perhaps uglier.
        desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
    private static void createAndShowGUI() {
        //Make sure we have nice window decorations.
        JFrame.setDefaultLookAndFeelDecorated(true); //:-)
        //Create and set up the window.
        Main frame = new Main();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //Display the window.
        frame.setVisible(true);
    }

I just need to be pointed to the right direction!eyes left.
scroll up a bit
"Search Forums", keywords
background image
(include swing forum in search)

Similar Messages

  • Setting the background image in a JFrame

    Hi all,
    I have a .gif that I want to display as the background image in a JFrame. How do I do that?
    regards,
    Mat

    Check out this thread:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=288769

  • All my dock settings, background pic, email setup is lost when restarted

    I had my computer customized to my preferences such as dock on left side, choosen background pic, i used entourage for email, etc.....i went into finder and under the user name (which has the house icon) i simply changed the name and when i rebooted my computer, all my settings got lost and it was like i was entering tiger for the first time, everything went back to original setting like when u first install tiger. the dock is at the bottom and every program i open has the user agreement like i have never used the program. itunes doesnt have any of my songs on there. when i click on the name that i changed in the finder, i find a subfolder with all my songs and settings but i dont know how to access them or reimplement them.....any suggestions? all my files are still somewhere on the computer since it says my memory is mostly used

    I f you changed the short user name in the finder that is a dangerous thing to do. See this document : How to change user short name or home directory name. If you notice this is recommended for advanced users only.
    You might be able to recover if you change it back to the original. An easier way is to use ChangeShortName. Please be sure to read the entire insructions. I can't guarantee this will work, but have read good comments on this utility. Good luck.

  • OS4 - Multitasking and Background PIC not working

    Hello Guys - I have IPHONE 3G and yesterday I just upgrade the OS4 on it.. I can create folders, I can zoom in - out camera however for some reason I CAN NOT do Multitasking and background pic is not there. DON't know why.. Is there something I am missing ?? any Settings you can suggest or DO I have to Format and re-install it again ?

    3G didn't get all the features. Original got none. Only 3GS and iPHone 4 gets multitasking.
    You will also notice you cannot change wallpaper behind apps.

  • How to change background pic without overwrite other items ?

    Hi I want to change the background pic for all my forms , but it seems that if I directly paste the new pic into the form, the existing frams and title words will be covered by the pic. Any way that can solve this problem ? Great thanks !

    when you choose the frame in the layout
    (Open the canvas) there are two buttons in the toolbar (bring front & sent to back)
    you can use them to solve your problem

  • Is anybody else having problem trying to put a background pic it won't zoom out?!

    Is anybody else having problem trying to put a background pic it won't zoom out?!

    Hi Daguyuluv2nv!
    I have some information for you that might help you with that issue:
    Reduce screen motion - iPhone User Guide
    http://help.apple.com/iphone/7/#/iph11d9baf58
    You'll want to turn that setting off in your iOS device in order to view your background picture the way you desire. Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • How can I make my desktop wallpaper as my background pic in Finder?

    Hi,
    How can I make my desktop wallpaper as my background pic in Finder?
    Thanks
    Ramesh

    The default background pictures are located here
    Finder>Go>Go to folder   copy and paste
    /Library/Desktop Pictures/
    http://www.youtube.com/watch?v=CZD1Lpro0lQ

  • How to set background color for a JFrame

    Hi,
    i am new to swing programming. I have created a JFrame called framehelp and i placed some labels in the frame.
    I have set the background color as yellow for the frame ie by setBackground(new java.awt.Color(255, 255, 204));
    But after compiling the program i am still getting the background color of frame as gray.
    How can i change the background color of frame as lightish yellow.
    I have used NETBEANS to generate this code and i am posting the code..
    Kindly help me
    Thanks in adavance
    public class framehelp extends javax.swing.JFrame {
        /** Creates new form framehelp */
        public framehelp() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            jLabel4 = new javax.swing.JLabel();
            jLabel5 = new javax.swing.JLabel();
            jLabel6 = new javax.swing.JLabel();
            jLabel8 = new javax.swing.JLabel();
            jLabel9 = new javax.swing.JLabel();
            jLabel10 = new javax.swing.JLabel();
            jLabel11 = new javax.swing.JLabel();
            jLabel12 = new javax.swing.JLabel();
            jLabel13 = new javax.swing.JLabel();
            jLabel7 = new javax.swing.JLabel();
            jLabel14 = new javax.swing.JLabel();
            jLabel15 = new javax.swing.JLabel();
            jLabel16 = new javax.swing.JLabel();
            jLabel17 = new javax.swing.JLabel();
            jLabel18 = new javax.swing.JLabel();
            jLabel19 = new javax.swing.JLabel();
            jLabel20 = new javax.swing.JLabel();
            jLabel21 = new javax.swing.JLabel();
            jLabel22 = new javax.swing.JLabel();
            jLabel23 = new javax.swing.JLabel();
            jLabel24 = new javax.swing.JLabel();
            jLabel25 = new javax.swing.JLabel();
            jLabel26 = new javax.swing.JLabel();
            jLabel27 = new javax.swing.JLabel();
            jLabel28 = new javax.swing.JLabel();
            jLabel29 = new javax.swing.JLabel();
            jLabel30 = new javax.swing.JLabel();
            jLabel31 = new javax.swing.JLabel();
            jLabel32 = new javax.swing.JLabel();
            jLabel33 = new javax.swing.JLabel();
            getContentPane().setLayout(null);
            setBackground(new java.awt.Color(255, 255, 204));
            setForeground(new java.awt.Color(204, 204, 204));
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            jLabel1.setText("The CAME framework software measurement process evaluation is used to determine the Level of  measurement in the ITarea. This measurementprocess evaluation is ");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(40, 50, 41, 16);
            jLabel2.setText("performed individually for software coomponents ie SoftwareProduct, SoftwareProcess and SoftwareResource.");
            getContentPane().add(jLabel2);
            jLabel2.setBounds(40, 70, 41, 16);
            jLabel3.setText("Below we describe the steps which will guide through the measurement process evaluation. There are two types of evaluation considerd here, General evaluation");
            getContentPane().add(jLabel3);
            jLabel3.setBounds(40, 100, 913, 16);
            jLabel4.setText("and Evaluation with respect to a standard. The measurement intensions considerd by varoius measurement standards will be used in our tool based method.  ");
            getContentPane().add(jLabel4);
            jLabel4.setBounds(40, 120, 893, 16);
            jLabel5.setText("Information about the measurement standards can be found at     www.iso.org ,    www.ieee.org.");
            getContentPane().add(jLabel5);
            jLabel5.setBounds(40, 140, 542, 16);
            jLabel6.setText("Steps to calculate the MetricsLevel");
            getContentPane().add(jLabel6);
            jLabel6.setBounds(40, 190, 199, 16);
            jLabel8.setText("2 )  The opened frame consists of several  metrics and measures, evaluation level buttons, result textfields and selection choice lists. To calculate");
            getContentPane().add(jLabel8);
            jLabel8.setBounds(70, 240, 41, 16);
            jLabel9.setText("general Metricslevel without any standard, select general from Measurement standard choice list. then select Both from scaleType choice list and finally select metrics ");
            getContentPane().add(jLabel9);
            jLabel9.setBounds(90, 260, 949, 16);
            jLabel10.setText(" and measures from the frame and press MetricsLevel Button. The metricslevel for the selected metrics will be displayed in textfield1.");
            getContentPane().add(jLabel10);
            jLabel10.setBounds(90, 280, 756, 16);
            jLabel11.setText("3 ) To determine MetricsLevel with respect to a standard select a standard from MeasurementStandard choice list, select Both from ScaleType choice list and finally ");
            getContentPane().add(jLabel11);
            jLabel11.setBounds(70, 300, 933, 16);
            jLabel12.setText("select darkened metrics and measures and press MetricsLevel Button. The Metrics Level for the selected Metrics and standard will be diplayed in textfield1.");
            getContentPane().add(jLabel12);
            jLabel12.setBounds(90, 320, 883, 16);
            jLabel13.setText("4 ) Repeat steps 1 2, 3  for ProcessMeasurementEvaluation and ResourceMeasurementEvaluation menu items from the select menu.");
            getContentPane().add(jLabel13);
            jLabel13.setBounds(70, 340, 751, 16);
            jLabel7.setText("1 ) Select ProductMeasurementEvaluation menu item from the select menu,a frame called CAME framework software product measurement evaluation will be opened. ");
            getContentPane().add(jLabel7);
            jLabel7.setBounds(70, 220, 946, 16);
            jLabel14.setText("Steps to calculate MeasurementLevel");
            getContentPane().add(jLabel14);
            jLabel14.setBounds(50, 390, 214, 16);
            jLabel15.setText("1 ) Select ProductMeasurementEvaluation menu item from the select menu,a frame called CAME framework software product measurement evaluation will be opened.");
            getContentPane().add(jLabel15);
            jLabel15.setBounds(80, 420, 943, 16);
            jLabel16.setText("2 ) The opened frame consists of several  metrics and measures, evaluation level buttons, result textfields and selection choice lists. To calculate");
            getContentPane().add(jLabel16);
            jLabel16.setBounds(80, 450, 822, 16);
            jLabel17.setText("general Measurementlevel without any standard, select general from Measurement standard choice list. then select Quantitative measures from scaleType choice list ");
            getContentPane().add(jLabel17);
            jLabel17.setBounds(100, 470, 943, 16);
            jLabel18.setText("and finally select metrics and measures from the frame and press MeasurementLevel Button. The MeasurementLevel for the selected metrics will be displayed in textfield2.");
            getContentPane().add(jLabel18);
            jLabel18.setBounds(100, 490, 973, 20);
            jLabel19.setText("3 ) To determine MeasurementLevel with respect to a standard select a standard from MeasurementStandard choice list, select Quantitative measures from ScaleType choice list");
            getContentPane().add(jLabel19);
            jLabel19.setBounds(80, 510, 1009, 16);
            jLabel20.setText("and finally select darkened metrics and measures and press MeasurementLevel Button. The MeasurementLevel  will be diplayed in textfield2.");
            getContentPane().add(jLabel20);
            jLabel20.setBounds(100, 530, 799, 16);
            jLabel21.setText("4 )Repeat steps 1 2, 3  for ProcessMeasurementEvaluation and ResourceMeasurementEvaluation menu items from the select menu.");
            getContentPane().add(jLabel21);
            jLabel21.setBounds(80, 550, 748, 16);
            jLabel22.setText("Steps to calculate MeasurementProcessLevel");
            getContentPane().add(jLabel22);
            jLabel22.setBounds(50, 600, 262, 16);
            jLabel23.setText("1 ) Select ProductMeasurementEvaluation menu item from the select menu,a frame called CAME framework software product measurement evaluation will be opened.");
            getContentPane().add(jLabel23);
            jLabel23.setBounds(80, 630, 943, 16);
            jLabel24.setText("2 )The opened frame consists of several  metrics and measures, evaluation level buttons, result textfields and selection choice lists. To calculate");
            getContentPane().add(jLabel24);
            jLabel24.setBounds(80, 650, 819, 16);
            jLabel25.setText("general MeasurementProcesslevel without any standard, select general from Measurement standard choice list. then select Quantitative measures from scaleType ");
            getContentPane().add(jLabel25);
            jLabel25.setBounds(100, 670, 930, 16);
            jLabel26.setText("choice list, enter migrated metrics if any in textfield  below migrated metrics label and finally select metrics measures from the frame and press ");
            getContentPane().add(jLabel26);
            jLabel26.setBounds(100, 690, 818, 16);
            jLabel27.setText("MeasurementProcessLevel Button. The MeasurementProcessLevel for the selected metrics will be displayed in textfield3.");
            getContentPane().add(jLabel27);
            jLabel27.setBounds(100, 710, 691, 16);
            jLabel28.setText("3 ) To determine MeasurementProcessLevel with respect to a standard select a standard from MeasurementStandard choice list, select Quantitative measures from ");
            getContentPane().add(jLabel28);
            jLabel28.setBounds(80, 740, 937, 16);
            jLabel29.setText("from ScaleType choice list, enter migrated metrics if any in textfield below migrated metrics and finally select darkened metrics and measures and press  ");
            getContentPane().add(jLabel29);
            jLabel29.setBounds(100, 760, 873, 16);
            jLabel30.setText("MeasurementProcessLevel Button. The MeasurementprocessLevel for the selected metrics will be displayed in textfield3");
            getContentPane().add(jLabel30);
            jLabel30.setBounds(100, 780, 687, 16);
            jLabel31.setText("4 ) Repeat steps 1,2,3 for ProcessMeasurementEvaluation and ResourceMeasurementEvaluation menuitems.");
            getContentPane().add(jLabel31);
            jLabel31.setBounds(80, 800, 618, 16);
            jLabel32.setText("Steps to calculate MeasuredSoftwareProcessLevl");
            getContentPane().add(jLabel32);
            jLabel32.setBounds(60, 830, 285, 16);
            jLabel33.setText("1 ) Follow the same steps as MetricsLevel calcualtion but select metrics and measures covered by CAME Tools only.");
            getContentPane().add(jLabel33);
            jLabel33.setBounds(90, 860, 657, 16);
            java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-1100)/2, (screenSize.height-940)/2, 1100, 940);
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            new framehelp().show();
        // Variables declaration - do not modify
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel10;
        private javax.swing.JLabel jLabel11;
        private javax.swing.JLabel jLabel12;
        private javax.swing.JLabel jLabel13;
        private javax.swing.JLabel jLabel14;
        private javax.swing.JLabel jLabel15;
        private javax.swing.JLabel jLabel16;
        private javax.swing.JLabel jLabel17;
        private javax.swing.JLabel jLabel18;
        private javax.swing.JLabel jLabel19;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel20;
        private javax.swing.JLabel jLabel21;
        private javax.swing.JLabel jLabel22;
        private javax.swing.JLabel jLabel23;
        private javax.swing.JLabel jLabel24;
        private javax.swing.JLabel jLabel25;
        private javax.swing.JLabel jLabel26;
        private javax.swing.JLabel jLabel27;
        private javax.swing.JLabel jLabel28;
        private javax.swing.JLabel jLabel29;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel30;
        private javax.swing.JLabel jLabel31;
        private javax.swing.JLabel jLabel32;
        private javax.swing.JLabel jLabel33;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JLabel jLabel5;
        private javax.swing.JLabel jLabel6;
        private javax.swing.JLabel jLabel7;
        private javax.swing.JLabel jLabel8;
        private javax.swing.JLabel jLabel9;
        // End of variables declaration
    }

    1. When you post code, post a minimal example. Did we have to scroll through
    all those bloody labels.
    2. Can't say much for the quality of code NetBeans generates.
    3. To answer your question (sorry, I don't have an autographed copy of the photo):
    import java.awt.*;
    import java.net.*;
    import javax.swing.*;
    public class Example {
        public static void main(String[] args) throws MalformedURLException {
            final JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            Container cp = f.getContentPane();
            cp.setBackground(new Color(0xff, 0xff, 0xee));
            cp.add(new JLabel("set the color on the content pane, not the frame"), BorderLayout.SOUTH);
            URL url = new URL("http://today.java.net/jag/bio/JagHeadshot-small.jpg");
            cp.add(new JLabel(new ImageIcon(url)));
            f.pack();
            SwingUtilities.invokeLater(new Runnable(){
                public void run() {
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    }

  • How do I change the background pic thats behind my speed dial thumbnails

    i put a pic in the browser window behind my speed dial thumbnails and i cannot remember how to change it.

    Figured it out - When looking at your speed dial screen, do a right click, off to the side of a dialer, and choose '''''edit group''''', then select '''''additional style options''''', from there you can select an image background or colour.

  • How to get Internal frames as well as a background image in a JFrame?

    Hi All,
    Here's my problem. I have a JFrame with a background image that I got by overridding the paintComponent() method of a JPanel and setting as the contentPane of a JFrame. Works great.
    Now what I want is to use internal frames with this Frame a la JInternalFrame classes. But you need to create a JDesktopPane object and set this as the contentPane of the JFrame to get internal frames to work, right? Is there a way for me to have my cake and eat it so I get both internal frames and a background image? Thanks!

    Hmmm,
    so simple, why didn't I think of that? Damn Mondays!
    thanks very much!

  • Setting the Background Graphics for a JFrame

    Hi,
    I am designing a GUI-based game and intend to set the background of my JFrame to a specific jgp graphic...I can't seem to find any method for setting the background in the JFrame API.
    Kindly assist!
    Cheers.

    Your search is perhaps marred by being too specific to frame. It is generally considered a bad idea to do any 'custom' thing directly to a frame. Try this search instead.
    [http://www.google.com/search?q=background+panel+java]

  • Why does my background pic look larger than it should and is not as clear as the original?

    When islet a pic as background it says I can adjust size, but cannot in fact the pic gets larger and not as clear, this started with IOS7

    This is due to the parallax effect in iOS 7. As you tilt the phone to the left or right, the background image moves with it, to give the home screen an illusion of depth.

  • Background pic for DVD menu

    I know that you can drop a pic into the menu background for your DVD, but I can't figure out how to strech or resize the pic from there. Most of the time, the pic is too big and I need to shrink it down to the size of the menu background. I know that you can click on it and slide the position of it up and down, but that's not really helping me.

    What theme are you trying to use?
    I mean do macbooks even come with a program that will resize pics?
    Of course....
    Do I have to go get photoshop just to find a solution?
    No...
    ... but you do need to spend some time learning about your new computer.
    If you have your image in iPhoto, you can simply File>Export>Size>Scale image no larger than (enter size) and preserve aspect ratio.

  • Desktop Background Pic Problem

    Okay, so I did the upgrade...
    On my account (the admin account) I can't seem to keep the desktop pic when I try use something other than this boring blue background.
    My mom's account (no admin privileges) works just fine though...
    Lil help?

    Try locating and deleting this preference/plist file:
    ~(yourUserName)/Library/Preferences/com.apple.desktop.plist

  • How to get background pics on main display where Aps are??/

    Hi
    I'm wondering how to put a picture as my background on my main display? I know how to get it for my background when it locks. I do not see an option to display it when I go to set/save the picture in my photos.
    I have gone to Settings-> Wallpaper-> pic the picture and save, but it does not give me anymore options besides just having it as my locked background picture!
    Please help! I have updated my phone today to the newest version!

    Hi
    Thanks for your quick responses. I thought i had the 3GS but i looked at my box and its only the 3G so maybe this is why I don't have an option for background for different backgrounds only the one as the screen saver when its locked boo! to that!!!
    Thanks though.
    ALSO another question.... Email... I used to be able to reply to my emails on my phone, but for some reason I cannot anymore, i can only receive them not reply> Any idea of what I can do. I"m with hotmail.
    Danielle

Maybe you are looking for