Setting picture as background

Can I use an image file as background in JFrame?
(i.e) Instead of painting with single color, can I set an image ?

Definitely.
1. Load the image into an Image
2. Create a JPanel, override it's paintComponent method, and call g.drawImage
3. call Frame.setContentPane with your panel with the background

Similar Messages

  • How can i set  picture as background using JPanel

    hello can you kindly tell me how i can set picture as the background of my jpanel instead of using set
    setBackground(Color.bule)

    you can use a JLayeredPane ; put a JPanel containing a JLabel based on an ImageIcon on the lowest layer of your JLayeredPane
    then, use upper layers to add components
    edit: another possibility is to override the "paint()" method of your JPanel container, and use drawImage() to paint the picture as a background

  • Pictures as Background or Screensaver

    Does the iPod 30GB have the ability to set pictures as backgrounds? Or are pictures just stored for viewing?
    PC   Windows XP   N/A

    it is not possible to set a wallpaper. images are just for viewing

  • How to remove the option "Set as default background..." from the right-click menu on a picture, for all users.

    Hi! I would like to know if there is any possibility to remove the option "Set as default background..." from the right-click menu on a picture, for all users. I know that's possible to edit userContent.css or userChrome.css, but this concerns only a profile at a time and being in a domain, I would like to set this for all people using Firefox.
    Can it be possible to edit a mozilla.cfg file to get the same result?
    Thank you in advance for help and tips.

    AFAIK then there is no way to do that system wide. You can only do that via userChrome.css or an extension like the Menu Editor per profile .You can install extensions globally, but the user will have to enable them anyway. That is not required for userChrome.css code.

  • I want put a picture on background of JFrame

    Hello, I�m using the JDK 5 ( with Windows), and I dev in a NetBeans.
    I would like to know?
    How Can I put the picture on background of JFrame?
    Or which component I use to show picture?

    A simple way would be to subclass a JPanel, override it's paintComponent method to display your image and set the panel as the frame's content pane. Take a look at
    JFrame#setContentPane(Component)
    JPanel#paintComponent(Graphics)
    and perhapt ImageIO.read(...) for loading the image.

  • [ANSWERED]Which terminals let you set a random background image?

    Many terminals nowadays let you set a background image on the terminal itself.
    Which terminals let you set a random background image from a directory or list of images? Also need to be able to have multiple terminals with different background images open, so having a script that moves around images won't work.
    I like this because when you have lots of terminals open, you can associate each with their background image. Also if your background image isn't a tiled thing or a stylized gradient (such as a human, etc), it might look bad when duplicated all over the screen.
    I could use transparency, but I don't like psuedo transparency, and real transparency comes with all sorts of problems. (For me at least.) I would still prefer having multiple background images though.
    Konsole and eterm are the only two I know that can do this, but konsole is KDE, and eterm has no unicode support, is dead (I think), and is ugly.
    Last edited by sokuban (2008-12-31 21:20:12)

    So now that time has passed and I'm on a clean new install, I decided to try out uxvrt again. The good news in that now I can type in it with scim. I have no clue how or why, but it means the greatest hurdle is gone.
    I also even managed to get a good looking English font.
    urxvt*font: xft:Monospace:pixelsize=12
    Only problem is a readable east asian font. The default font is a mess and everything is squished together. If I explicitly select an east asian font, then there are huge spaces between each letter, even for english. So I find out this is a known bug, and I find a patched aur package for it, but the patch doesn't seem to make a difference.
    I know urxvt lets you select a main font and a secondary font and so on. Maybe I did the syntax wrong. I tried both:
    urxvt*font: xft:Monospace:pixelsize=16
    urxvt*font: xft:WenQuanYi Zen Hei:size=9:antialias=True
    and
    urxvt*font: xft:Monospace:pixelsize=16,urxvt*font: xft:WenQuanYi Zen Hei:size=9:antialias=True
    Neither of them worked. From what my understanding of what the man page says, the size of the cell is supposed to be based on the main font, but in both those cases the secondary font stretches the cells.
    Can anybody reccomend fonts for east asian scripts that work well and show me your .Xdefaults ?
    FAKE EDIT: I just thought of an idea, and it kinda works:
    urxvt*font: xft:Monospace:pixelsize=16,xft:WenQuanYi Zen Hei:size=9:antialias=True
    Now I get a readable font, but massive spacing issues between Chinese Characters.
    EDIT: About the pixmaps, I got a script to randomly select and image and all is fine, but I can't seem to find a way to disable scaling. I can set the size of the picture by a percent, but it doesn't let me use decimals and it is impossible to get the exact resolution of the picture to display. (Unless I let it tile, but the pictures I am using aren't meant to be tiled.) Is there a way to either disable scaling, or set the urxvt size in pixels so I could make it exactly 640x480. The urxvt man page says that a scale of 1 disables scaling, but it seems to have no effect.
    EDIT2: I just noticed I can't use scim now. I have no clue why, but I think compiling it with afterimage support breaks it.
    EDIT3: I found out why scim was not working/working. I had to add this to my ~/.scim/global:
    /SupportedUnicodeLocales = en_CA.UTF-8
    I also got a script that works, kinda:
    #!/bin/bash
    image="$(ls /usr/local/share/cgs | sort -R | tail -1)"
    urxvt -pixmap /usr/local/share/cgs/$image\;86x100
    The only problem is that I don't know how to get urxvt -pixmap to keep the aspect ratio of the image. 86x100 is the closest it will let me get to the actual aspect ratio, but it is off slightly. Barely noticable. The man page says that propscale will do this, but it doesn't seem to work.
    Either way, for now, I am just going to use 86x100.
    Last edited by sokuban (2009-03-22 02:01:45)

  • How to set CAM Mode background wallpaper

    Hi forum users,
    Where can i download or find the "xv" application ?
    Thanks.
    # Yours Sincerely,
    # Mohamed Ali Bin Abdullah.
    Anthony Worrall wrote:
    In chapter 10 "Control Access Mode" of the "Sun Ray Server Software 3.1
    Administrator's Guide for the Solaris Operating System"
    http://docs.sun.com/source/819-2384/cam.html
    To Change the Backdrop
    1. Run xv (version 3.10 or later) on any desired image.
    2. Save the file as "XPM". Rename the file from <>.xpm to <>.pm.
    3. Edit the file /opt/SUNWut/kiosk/prototypes/dtsession/Dtwm and change
    the two backdrop lines to the full pathname of the <>.pm file.
    You can also place the <>.pm file in /usr/dt/share/backdrops and then
    refer to it by <> in the Dtwm file.
    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]] On Behalf Of Mohamed Ali Bin
    Abdullah
    Sent: 16 August 2006 13:14
    To: [email protected]
    Subject: [SunRay-Users] How to set CAM Mode background wallpaper
    Importance: High
    Dear SunRay Fourm Users,
    I need help regarding Sun Ray CAM mode background wallpaper settings.
    My objective is that, non-card users( DTUs ) will start the Controlled
    Access Mode. In CAM mode i don't want any application to be launch. I
    want CAM mode background shows only my wallpaper( jpg format ). Users
    with card can access the system( dtlogin ). I have set those policy in
    SunRay Web Administration Console and restart the services.
    My question is, how can i set or configure the CAM mode background to
    show my wallpaper( jpg fornat ) ?
    These are my setup environment information:
    - Sun E220( Sparc )
    - Installed Solaris 10 06/06 OS.
    - Installed latest Solaris 10 recommended patches
    - SunRay Server Software 3.1
    - Installed patch 120879-04
    - 2x SunRay 1
    - 2x SunRay 150
    - 2x SunRay 170
    I would be thankful if anyone can offer me help and guidance.
    Please let me know if you need any more information.
    # Yours Sincerely,
    # Mohamed Ali Bin Abdullah.

    Hi forum users,
    Where can i download or find the "xv" application ?blastwave.org has it for example

  • How do I disable "Set as Desktop Background" as an option in Firefox 3.6 running on Mac OSX 10.5?

    I'm trying to disable the "Set as Desktop Background" option for Firefox 3.6 in a Mac OSX 10.5 environment. I have a default image that I want as the background on my desktop and I don't want it to be changed.

    See http://kb.mozillazine.org/Editing_configuration#How_to_edit_configuration_files
    Add code to [http://kb.mozillazine.org/UserChrome.css userChrome.css] below the @namespace line.
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #context-setDesktopBackground {display: none !important;}</nowiki></pre>

  • Set current row background color

    during post-query process, if record meets condition,
    i would like to set the color of entire line.
    thank you
    [email protected]

    Hi Jim,
    create a visual_attribute named e.g. PQR and set the desired background color.
    In post-query trigger:
    declare
         currec number := Get_block_property('block1', current_record);
    begin     
    if "condition" then
         set_item_instance_property('item1',     currec,visual_attribute,'PQR');
         set_item_instance_property('item2',     currec,visual_attribute,'PQR');
         set_item_instance_property('item3',     currec,visual_attribute,'PQR');
    end if;
    end;
    Good luck,
    Monica

  • How to set Analysis graphics background color to Transparent? not White.

    How to set Analysis graphics background color to Transparent? not White.
    thanks
    Edited by: user13257485 on 2010-8-15 下午11:53
    Edited by: user13257485 on 2010-8-15 下午11:55

    Hi,
    We almost had the same requirement, but we just needed to color a specific column.
    Here goes the solution to that, you might do the same for your row highlighting
    Changes are required in jsff and one method to be added in backing bean
    1. JSFF :
    <af:column headerText="Amount"
                     id="c4" width="100"
                     inlineStyle="#{backingBeanScope.BackingBean.cellColor}">2. Backing Bean
    //searchResultTableVO is Table's VO
    public String getCellColor() {
          FacesContext ctx = FacesContext.getCurrentInstance();
          ExpressionFactory ef = ctx.getApplication().getExpressionFactory();
          ValueExpression ve = ef.createValueExpression(ctx.getELContext(), "#{row}", FacesCtrlHierNodeBinding.class);
          FacesCtrlHierNodeBinding node = (FacesCtrlHierNodeBinding)ve.getValue(ctx.getELContext());
          Row row = node.getRow();
        if(row.equals(searchResultTableVO.getCurrentRow())){
    //You can add your inline style for font-style too
          return "background-color:Red;";
             return null;
      }Hope this is helpful :)
    Regards,
    Neha..

  • Set all TextField background color

    I searched the help and online for how to accomplish this and
    came up with the following code. It would seem to me that there is
    a more straight forward way but this is the best I could manage.
    Any suggestions on how improve this. Also I could not get the 'for
    in' or 'for each in' to work, the loop would not iterate when
    applied to the page_mc.

    Hi,
    You can set this in the Border palette.
    You might also want to set a white background for the value area (in the Object > Field palette) and zero margins in the Layout palette.
    Hope that helps,
    Niall
    Assure Dynamics

  • Setting a default background color

    Hi All,
    I would like to set a default background color for all the
    components that I'm going to draw. What is the best
    way to achieve this?
    Thanks.
    Syed

    You can set using UIManager of the Look and Feel.
    UIManger.put("Button.background", Color.blue);
    will set the color of all the JButtons to blue. Like that you can change for all the components you need.
    Mohan

  • Can i make the setting and keyboard background black ? , because i have vision problem and the white color is too bright and cause pain and headache for me . thanks

    can i make the setting and keyboard background black ? , because i have vision problem and the white color is too bright and cause pain and headache for me . thanks

    Drmikekuna wrote:
    ... Sony AVCHD .. Canon SD ... Logitech .. Flip Mino HD. ..
    .. Certainly not the best idea for a professional but just fine for a guy who likes to edit for fun.
    that's were the fun stops on a MacOs-based system ..
    FC/e supports only a few 'standards': DV (as from miniDV cams), HDV (from miniDV devices), AVCHD (from most devices) and with a little trick, described on my website AVCHD-light (720p, as from many compact-stills) ..
    done.
    some Flips are supported by iMovie, which you can abuse as a converter tool.
    but 'non video standard' (=read 'video' as 'in TV') formats, resolutions and codecs ...
    a) manual conversion = less convenient
    b) loss of 'quality', e.g. when you blow-up tiny 480x320/15fps into video..
    FC/e is FC/pros lil' brother.. meant for a more.. adult workflow..
    if you like to wrestle with multi-formats, stay with Windows/Magix/..
    Windows=options, with a chance of getting lost
    MacOs=convenience, with a chance of getting restricted

  • HT4356 My Ipad prints to my airprinter that works OK but how do I set picture size/position etc

    My Ipad prints to my airprinter that works OK but how do I set picture size/position etc. At the moment from the photos app it prints an A6 photo in top left corner. How do I change that to something different.

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    If you put photo paper in the printer it will print correctly on the paper. Also, some photo printers will adjust the size photo printed when you put different size photo paper in the tray.

  • Setting a transparent background

    Is it possible to set a transparent background in Aperture 3? i.e. erase the background of a photo to plane white then setting the transparency for plane white. Attempting to make a transparent background to add the image to a photo.
    r/
    Patrick

    Welcome to the list. Make sure you read the [Help & Terms of Use|http://discussions.apple.com/help.jspa] section when you get a chance.
    No its not possible. You'll need something like Gimp or PS for that.

Maybe you are looking for

  • Problem in Reducing the root file system space

    Hi All , The root file system is reached 86%. We have cleared 1 GB data in /var file system. But the root file system still showing 86%. Please note that the /var file is not seprate file system. I have furnished the df -h output for your reference.

  • Error Accessing Services tab in Portal Application.

    Hi I have successfully connected to Oracle UCM server from JDeveloper and Now I can see my folders and files that I have created in UCM from JDeveloper. But When I run the application and go to services tab It gives the following error. I have also e

  • Safari, Lion and YouTube Internal Error message

    I have two user accounts set up on my iMac, one for me and one for my wife.  This worked fine with Snow Leopard. I've just upgraded to Lion. All appears perfectly normal, with the exception of YouTube. I can access YouTube without any problems on my

  • Anybody got Tilp2 working? (Tool for connecting TI calculators to PC)

    Hello^^ like the title says, I'm trying to get my TI v200 connected to the PC. But Tilp2 doesn't find the device. I'm using a silverlink (usb) cable and added none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0 to my fst

  • Premier Elements 12, windows 7 64 bit pro

    When editing, half way through my program, when DTI is moved when I make a cut, the video on the time line that is visible does not change. I quiet and started again, and the same happened when I was half way through my program [email protected]