Adding Background

I have made a stand-alone app using JPanel and want to add a Image (tiled), instead of color, as a background. Can someone help me pse.

create a custom JPanel, e.g.
public class BackgroundJPanel extends JPanel {
     Image backImage;
     public BackgroundJPanel() {
         super();
         //load the image
      public void paint(Graphics g) {
           //g.drawImage(image, ....)
           //If you want to tile the image, repeat the image many times
}Now, you can use this class instead of JPanel

Similar Messages

  • I added background music to the video clip, but I only hear noise, no video clip audio or the background music audio

    I added background music to the video clip in iMovie, the playback runs ok on the right corner preview screen, if I share it to movie clip or itunes or theather, I only hear noise, no video clip audio or the music audio
    If I don't put additional audio to the clip. audio effect or music background, the video plays normally
    I detached the audio from the video clip and deleted it, that way it was possible to listen to the music background and see the actual video clip, but no audio from the video clip.
    How can I have both?

    Hi
    My first thought is -
    Where are the original Audio file ?
    If it was on an Audio-CD then the CD is Ejected and one tries to play the movie - it can not find it = Silence.
    You are using an Non-Destructive Video editor - meaning that You have raw material - Video, Audio and photos but no Movie in Project - only a text document directing How You want it to be played. So if Audio is not where it was when this document were created - iMovie can not find it and e.g. audio goes silent.
    Yours thinking - Bengt W

  • Acrobat 9 Pro - Text Distortion on adding background

    Hello,
    I hope someone can help me with this as it's driving me up the wall!
    In ye olde days of version 8 my work flow used to go like this:
    Write XYZ in MS Word 2007.
    Export to PDF.
    Open up exported PDF and see the crisp and soft lovelyness of my chosen none standard font displayed in front of me.
    I would then add our companies background to all the pages in the PDF (a PDF I created full page from Illustrator CS3).
    Pop the front and rear covers on.
    Send to a client or whatever.
    Now we have upgraded to Acrobat 9 I have a bit of an issue.
    I go along the same route and all is fine until I add the background (I can even add the pages in before the background and it's fine).
    As soon as the background is added the font goes from crisp and smooth to bolder and jaggier and no matter what I do I just can't clean it out.
    At the moment we have only had to send out one document like this, but they are backing up until I can get this fixed, it's not something we can realistically show to a client when we are supposed to be graphic designers and pride ourselves on our output.
    Any ideas?
    Regards
    Paul

    Thanks for your suggestion! That actually did work pretty well.
    I had set up all the fields as non-rich text, cut and pasted the text into the fields, and then change the fields back to rich text to format them (ie superscript, subscript etc).
    Unfortunately, now I'm faced with another problem.
    I won't be able to add more "unformatted" text later on easily. It appears that to do so, I would have to change the fields to non-rich text which wipes out all the formatting I've already applied.
    Any suggestions?
    Cheers,
    Trish

  • Added Background does not appear in PDF

    I tried this and had problems - opened up a Catia sample in Toolkit, used 'Open Background' to add a jpeg background (blue waves). Worked fine, and when I exported to .u3d, then opened that, I could see that the background was there as you'd expect - behind the 3d Catia sample.
    However, when I placed the .u3d file into an Acrobat3D pdf, the background disappeared (just saw the default gray). Tried with other examples, same thing.
    Do you know why this is happening? Thanks.

    Thanks, sws
    I'll have to experiment - what is slightly confusing is that changing the background for one item seems to keep it there for the next. So maybe when I opened up the saved .u3d and 'saw' the background, it was not so much saved in the u3d, as being added by 3d Toolkit itself.
    I'll add it to my growing list of experiments.

  • Adding background image to navigation tabs

    I am adding a backgraound image to a navigation tab and so far have found the only way to do this is by modifying the HTMLTableCell class and adding a method that sets the background image. The closest existing method is setBgColor - which doesn't work.
    I'm sure there has to be a better way to do this?
    Thanks

    My favorite technique is to use CSS. Try this in a stylesheet:
    BODY { background-image: url(marble.gif);           background-color: #cccccc; } P { background-image: none;           background-color: #cccccc; }
    For more information visit http://css.nu/.
    You can apply that style to a <DIV> you use to bound your header, for instance.
    David Phipps
    Plumtree Software

  • Adding background to Acrobat DC file makes large file

    Help! In the past (as recently as Acrobat XI) I have made mail-merged envelopes using Microsoft Word, then added a background PDF of the envelope in Acrobat. In December a file of about 2700 pages was only a few megabytes. Today I made a file of only 1705 pages worth of addresses, added a similar-sized envelope background, and the file is almost a terabyte! What's going on?

    Then why -- when I do EXACTLY the same thing in either X or XI do I get a file that is only a few megabytes and works fine? In DC the same procedure produced a file that was almost a terabyte! Sorry, but something pretty basic has changed between XI and DC. Hope someone can pass this info to those who can do something.

  • Adding background image to Spry Menu Bar?

    Hi Everyone,
    I have a question concerning adding a background image to a horizontal spry menu.
    1) I am using Dreamweaver CS4.
    2) I am inserting this menu bar on a HTML document.
    3) I have created and am using an external style sheet (CSS)
    I am not sure on which style(s) ("ul.*) to edit in order to acheive this.
    I have a total of four(4) different images I would like to use, they are...
    1) Horizontal Menu Bar (main menu bar)
    2) Horizontal Menu Bar - Rollover
    3) Submenu
    4) Submenu - Rollover
    Also I would like the text to be centered on the button.
    I have somewhat acheived this using the instructions for "customize this widget", yet the image "repeats" because the button is larger than the image.
    I have not tried to center the text, this may be a very simple thing, if so just let me know.
    What I dont know, and was hoping someone could tell me, is which style(s) ("ul.*) to edit in order to acheive this.
    If anyone needs anymore information, just let me know and I will give it to you as soon as possible.
    Also I have attached three(3) of the four(4) pictures I would like to use. (this is the maximum)
    Any help will be greatly appreciated,
    Musicman1994

    I'd like to thank everyone with their help so far, but I am still having trouble.
    I have tried both suggestions and the results are...
    The one suggested by dhvani2511 gave me this...
    (The cursur is over "Item 1" it is not blue when a cursur is not over it.)
    I would like the image to "be" the button, not just "in" it,if that makes sense.
    I have slightly tried the one suggested by .V1 but being that I am new to dreamweaver, code, etc. I am not sure where to copy/paste the code that you gave me.
    Does anyone have anymore information?
    Thanks,
    Musicman1994

  • Adding Backgrounds on JPanels

    Could anyone help with the following code; I am trying to put two JPanels on a JLayeredPane and have one of them act as background; the code goes like this
    /** The game has been implemented as part of the final
    project for CSc322
    *     @author Zengine Productions version 1
    // This is the main frame
    import java.lang.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class SpaceBall
    //To do the background just draw a JPanel inside
    another JPanel just set the opacity of the outside one
    to false and let
    //it hold all the components of the game
    public static void main(String[] args)
    //declaring the buttons
    JButton test=new JButton("test");
    JButton test1=new JButton("test1");
    JButton test2=new JButton("test2");
    //declaring and setting the properties of the frame
    JFrame SpaceBall= new JFrame("Space Ball"); // the
    game window
    SpaceBall.setSize(700,750);
    //declaring the Panels
    JLayeredPane bgPanel= new JLayeredPane(); // the
    panel that holds the background image
    JPanel fgPanel= new JPanel(); // the panel that
    holds all the game objects
    JPanel topPanel= new JPanel(); // the panel on top
    of the game panel
    JPanel sidePanel= new JPanel(); // the panel on the
    side of the game panel
    JPanel lowPanel= new JPanel(); // the panel that
    will hold bgPanel and sidepanel
    JPanel masterPanel= new JPanel(); // the panel that
    holds everything to be added to the JFrame
    //adding the buttons to the corresponding panels
    fgPanel.add(test1);
    sidePanel.add(test2);
    topPanel.add(test);
    // ImageIcon background= new
    ImageIcon("images/background.jpg");
    // JLabel backlabel = new JLabel(background);
    // bgPanel.add(backlabel, new
    Integer(Integer.MIN_VALUE));
    backlabel.setBounds(0,0,background.getIconWidth(),background.getIconHeight());
    fgPanel.setOpaque(false);
    bgPanel.add(fgPanel);
    bgPanel.setForeground(Color.white);
    //adding bgPanel and sidePanel to lowPanel
    lowPanel.setLayout(new GridLayout(1,2));
    lowPanel.add(bgPanel);
    lowPanel.add(sidePanel);
    //adding the Panels to the masterPanel
    masterPanel.setLayout(new GridLayout(2,1));
    masterPanel.add(topPanel);
    masterPanel.add(lowPanel);
    //getting the container of SpaceBall and adding the
    Panels to it
    Container cp=SpaceBall.getContentPane();
    cp.add(masterPanel);
    //displaying everything
    SpaceBall.show();
    WindowListener ClosingTheWindow=new WindowAdapter()
    public void windowClosing(WindowEvent e)
    System.exit(0);
    SpaceBall.addWindowListener(ClosingTheWindow);
    Could anyone point out any bug in the code that keeps it from displaying the button on the background Panel!
    Thanks

    Thanks Wekion but I think the editor messed up the format of my code; below is the exact one that I try to run but never get the result that I seek!
    // This is the main frame
    import java.lang.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class SpaceBall
    //To do the background just draw a JPanel inside another //JPanel just set the opacity of the outside one
    //to false and let
    //it hold all the components of the game
    public static void main(String[] args)
    //declaring the buttons
    JButton test=new JButton("test");
    JButton test1=new JButton("test1");
    JButton test2=new JButton("test2");
    //declaring and setting the properties of the frame
    JFrame SpaceBall= new JFrame("Space Ball");
    SpaceBall.setSize(700,650);
    //declaring the Panels
    JLayeredPane bgPanel= new JLayeredPane();
    JPanel fgPanel= new JPanel();
    JPanel topPanel= new JPanel();
    JPanel sidePanel= new JPanel();
    JPanel lowPanel= new JPanel();
    JPanel masterPanel= new JPanel();
    //adding the buttons to the corresponding panels
    fgPanel.add(test1);
    sidePanel.add(test2);
    topPanel.add(test);
    ImageIcon background= new ImageIcon("images/background.jpg");
    JLabel backlabel = new JLabel(background);
    backlabel.setBounds(0,0,background.getIconWidth(),background.getIconHeight());
    backlabel.add(test1);
    bgPanel.add(backlabel, new Integer(0));
    fgPanel.setOpaque(false);
    bgPanel.add(fgPanel, new Integer(100));
    bgPanel.moveToFront(fgPanel);
    //adding bgPanel and sidePanel to lowPanel
    lowPanel.setLayout(new GridLayout(1,2));
    lowPanel.add(bgPanel);
    lowPanel.add(sidePanel);
    //adding the Panels to the masterPanel
    masterPanel.setLayout(new GridLayout(2,1));
    masterPanel.add(topPanel);
    masterPanel.add(lowPanel);
    //getting the container of SpaceBall and adding the Panels to it
    Container cp=SpaceBall.getContentPane();
    cp.add(masterPanel);
    //displaying everything
    SpaceBall.show();
    WindowListener ClosingTheWindow=new WindowAdapter()
    public void windowClosing(WindowEvent e)
    System.exit(0);
    SpaceBall.addWindowListener(ClosingTheWindow);

  • Adding background music to video.

    What is the difference between music added that shows in green background under the videos and that in purple that covers top and bottom of video?  How do you get the purple one?

    Green indicates background music that is free floating as you add or delete clips. Purple indicates music pinned to a particular point in your video.
    This article explains how to pin and unpin your music:
    http://support.apple.com/kb/PH2259
    Matt

  • Adding background image to JFrame

    This is the code I have now. I want to add a background image to the JFrame, and it needs to be where i type the file name of the image into the program code and it loads it from my computer.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class GUIFrame extends JFrame implements ActionListener, KeyListener
         Display myDisplay;
         Button guess;
         Button solve;
         TextField input;
         JTextArea guessedLetters;
         MenuBar myBar;
         Menu fileMenu;
         MenuItem fileNewGame;
         MenuItem fileQuit;
         * constructor sets title of GUI window
         GUIFrame()
              super("Hangman");
              setSize(1000,600);
              guess = new Button("Guess");     
              guess.setFocusable(false);
              solve = new Button("Solve");     
              solve.setFocusable(false);
              input = new TextField(20);
              guessedLetters=new JTextArea(10,10);
              guessedLetters.setEditable(false);
              myBar=new MenuBar();
              fileMenu=new Menu("File");
              fileNewGame=new MenuItem("New Game");
              fileQuit=new MenuItem("Quit");
              myDisplay = new Display();     //make an instance of the window
              setLayout(new FlowLayout());     //How things are added to our Frame
              add(myDisplay);
              add(guess);
              add(solve);
              add(input);
              add(guessedLetters);
              setMenuBar(myBar);
              myBar.add(fileMenu);
              fileMenu.add(fileNewGame);
              fileMenu.add(fileQuit);
              addKeyListener(this);
              guess.addActionListener(this);
              solve.addActionListener(this);
              setVisible(true);     //make the frame visible
         * exectues when user presses a button.
         public void actionPerformed(ActionEvent e)
         public void keyPressed(KeyEvent e)
         public void keyReleased(KeyEvent e)
         public void keyTyped(KeyEvent e)
    }

    Look in the API under JFileChooser and Scanner to see how to get the file name. One you have it, you can load the file easily using several different methods...
    This is even easier, you can paint and image onto anything you like with this method:
    g.drawImage(image, 0, 0, null); //where g is the graphics context from the object you want to paint.
    Simple as that.
    The biggest problem you'll have with painting images onto other objects is making sure the image is loaded before you try to draw it; use ImageIO to load or add your image to a MediaTrakker after your load statement like this:
    Image im = (Image)ImageIO.read(new File("c:/myImages/myImage.jgp"));
    or
    BufferedImage bi = ImageIO.read(new File("c:/myImages/myImage.jgp"));
    or
    Image image = Toolkit.getDefaultToolkit().getImage("c:/myImages/myImage.jgp");
    MediaTracker mediaTracker = new MediaTracker(jf);
    mediaTracker.addImage(image, 0);
    mediaTracker.waitForID(0);
    BTW: what this means it that you can paint right onto the graphics content of the JFrame and not have to worry about any other containers if you want.
    If you expect the image to last more than just a flash, then you also need to override your paintComponents(Grahics) method to paint your graphics to your screen.

  • Adding Background Music Underneath Narration on a Single Slide in Capt 5

    I just finished putting together my first Adobe Captivate 5 project and  there is one last detail I need to learn how to do. I have recorded  narration on every slide. I now want to insert background music  underneath my title (first) slide and on the conclusion (last) slide.   Somehow I accomplished this on the first slide, but I cannot remember  how I did it and cannot seem to replicate it on the last slide. I  imported the jingle called Corporate Video2 from the Adobe library. When  I click on my last slide and go to Properties and click Edit Audio, I  hear my narration. When I click on my last slide and then go up to the  little music note icon up top on the toolbar called “Background Audio” I  see and hear the corporate video jingle. How do I meld these into one audio file? What is the  proper technique to add background audio? Should you lay down the  background music first and then record audio or the other way around? Is  there some little trick or glitch I’m missing? I only want to do this on one slide, not the entire project. When I preview the  project I only get narration, no music, even though when I go to  Background Audio, it looks like I have successfully imported the music  file. PLEASE HELP! I got this far and want to put this project to bed!  Thank you.

    Hi there,
    Welcome to Adobe Captivate Forums
    In Captivate audio can be recorded to 1. Slides, 2. Objects and 3. Project background.
    So you can record in whatever way you want to. In the case from what you mention, i can understand that you need to add background audio to first and last slide of your project.
    First let me explain you that background audio will be for the entire project. So if you add an audio to project background then it plays for the project till the end of audio. If you want the audio to loop over and play again then you need to enable that option in background audio dialog. This way audio will play in background for the entire project.
    Now considering your case i can understand that you have recorded audio for individual slides. So the slides already have a audio and you cant add two audio files to the slide. To accomplish this what you can do is to insert a text caption on first slide ( and last slide) of the project and make the text caption transparent. Later you can delete the text of the text caption . This way you have an object on slide which is not visible to others. Now you can import audio( background music) to this text caption and in the published output you can hear the audio from the text caption and the slide audio.
    This will give you narration + Background audio on specific slides effect.
    Try it out and let us know if you wanted anything more than this.
    Thanks
    Ashwin Bharghav B
    Adobe Captivate Team

  • Adding Background to PDF: Using a source file in Saved Settings Adobe Acrobat 9 Pro...

    I frequently need to print purchase orders and use another PDF file as the background. There is an option to save a setting in the "Add Background" option, but when this is used neither the background nor the positioning is adjusted. Any help or tips to simplify my process would be greatly appreciated as it is time consuming to browse for the file and adjust the positioning multiple times everyday.
    Thanks.

    Bump

  • In imovie 11 when adding background music it always goes to any open spot where I want to keep recorded sound only how can I designate where background music starts without having to drag to where it should start. any help out there thanks

    How to add background music to a specific point in imovie 11 it now just goes to any open spot that has origional sound I want to keep I then have to drag it to where I want it located am I missing something  need some help Please.

    Drag it from the Music Browser to the frame of video where you want it to start and drop it there. It will appear as a colored ribbon beneath the video clips, rather than as a colored background.

  • Adding background image to portlet title bar

    Hi,
    Does anyone know how to add a background image to a portlet title bar. I have tried using the LAF editor but nothing seems to work. The image will be static and not change.
    Any help appreciated.

    Hi Chris
    You have to modify the .css file depending on the type of Skin you are using like "default" or "bighorn" in case of 10.x and 9.x etc. Best thing is to install Firebug for Firefox and inspect the Titlebar in firebug. That should tell exactly which .css file and which element in that .css file is used to render the Portlet Title bar.
    For "default" skin, the file is window.css and the element in this file is ".bea-portal-window-titlebar" with background-color: #XXXXXX. Replace this or add another field like background-image: url(your image path). This window.css file can be found under WebContent\framework\skins\default\css\window.css. Remember that in 9.x and 10.x to see this file from Workshop IDE, you need to switch view to Merged Projects and select this file and copy this to your project to view it. BUT, I would not recommend to modify any out of box .css file. Instead create a new file custom.css file and add entries in this file which you want to overwrite. This is the standard way to customize any out of box skins look and feel. So in your custom.css file your will have one entry like this:
    .bea-portal-window-titlebar {
    background-image: url(your image path)
    For "bighorn" skin introduced in 9.x and 10.x, the elements in .css files are slighty different but the concept is same. I customized out of box bighorn skin to change background color of portlet title bar. The .css location for portlet title bar for bighorn skin is: WebContent\framework\skins\bighorn\css\colors.css and the element is ".wlp-bighorn-titlebar". For quick testing from Firebug, inspect this element and change the background color to something else and see if it reflects in Firefox. Then you can create custom.css file under same folder structure in your portal web project and over write this element and this field alone with the background-image that you want something like:
    .wlp-bighorn-titlebar {
    background-color:#FF0000;
    background-image:url(your image path);
    It is highly recommended to have all customizations go into custom.css file only. Please make sure that you have this custom.css file entry in the skin.xml file (in case of bighorn) or skin.properties file (in case of old legacy default skin). This .xml or .properties file can be found under same folder structure like: WebContent\framework\skins\yourSkin. For new bighorn skin.xml file this custom.css file entry is already there. But for old legacy default skin you may need to add this entry.
    HTH
    Ravi Jegga

  • Adding background image to JPanal...............PLEASE PLEASE HELP

    Hi,
    i am very very stuck in adding a image to a JPanel. here is my code could any one please show me where and how to add an image to this please. a sample code would be prefered.
    Thanks
    * card.java
    public class card extends javax.swing.JFrame {
    /** Creates new form card */
    public card() {
    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() {
    java.awt.GridBagConstraints gridBagConstraints;
    jPanel1 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    getContentPane().setLayout(new java.awt.GridBagLayout());
    setTitle("Card Game");
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(java.awt.event.WindowEvent evt) {
    exitForm(evt);
    jPanel1.setLayout(new java.awt.GridBagLayout());
    jPanel1.setBackground(new java.awt.Color(255, 255, 255));
    jLabel1.setIcon(new javax.swing.ImageIcon("card game implementation\\headingF1.jpg"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.insets = new java.awt.Insets(5, 145, 0, 205);
    jPanel1.add(jLabel1, gridBagConstraints);
    jButton1.setIcon(new javax.swing.ImageIcon("card game implementation\\Nigat\\helpbuttonF.jpg"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.ipadx = -36;
    gridBagConstraints.ipady = -10;
    gridBagConstraints.insets = new java.awt.Insets(83, 40, 130, 40);
    jPanel1.add(jButton1, gridBagConstraints);
    jButton2.setIcon(new javax.swing.ImageIcon("card game implementation\\Nigat\\newgame1.jpg"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.ipadx = -39;
    gridBagConstraints.ipady = -12;
    gridBagConstraints.insets = new java.awt.Insets(213, 40, 0, 40);
    jPanel1.add(jButton2, gridBagConstraints);
    jButton3.setIcon(new javax.swing.ImageIcon("card game implementation\\Nigat\\quit1.jpg"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.ipadx = -39;
    gridBagConstraints.ipady = -12;
    gridBagConstraints.insets = new java.awt.Insets(80, 40, 70, 40);
    jPanel1.add(jButton3, gridBagConstraints);
    jPanel2.setLayout(new java.awt.GridBagLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.ipadx = 420;
    gridBagConstraints.ipady = 400;
    gridBagConstraints.insets = new java.awt.Insets(43, 60, 40, 0);
    jPanel1.add(jPanel2, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 1);
    getContentPane().add(jPanel1, gridBagConstraints);
    pack();
    /** 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 card().show();
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    // End of variables declaration

    My images loaded up just fine. I left them in and commented out. Try using the single forward slash below...
    public class CardTest extends javax.swing.JFrame {
        /** Creates new form card */
        public CardTest() {
            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() {
            java.awt.GridBagConstraints gridBagConstraints;
            jPanel1 = new javax.swing.JPanel();
            jLabel1 = new javax.swing.JLabel();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            jButton3 = new javax.swing.JButton();
            jPanel2 = new javax.swing.JPanel();
            getContentPane().setLayout(new java.awt.GridBagLayout());
            setTitle("Card Game");
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            jPanel1.setLayout(new java.awt.GridBagLayout());
            jPanel1.setBackground(new java.awt.Color(255, 255, 255));
            jLabel1.setIcon(new javax.swing.ImageIcon(
                            //"images/T1.gif"));
                            "card game implementation/headingF1.jpg"));
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.gridwidth = 2;
            gridBagConstraints.insets = new java.awt.Insets(5, 145, 0, 205);
            jPanel1.add(jLabel1, gridBagConstraints);
            jButton1.setIcon(new javax.swing.ImageIcon(
                             //"images/T2.gif"));
                             "card game implementation/Nigat/helpbuttonF.jpg"));
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 1;
            gridBagConstraints.gridy = 1;
            gridBagConstraints.ipadx = -36;
            gridBagConstraints.ipady = -10;
            gridBagConstraints.insets = new java.awt.Insets(83, 40, 130, 40);
            jPanel1.add(jButton1, gridBagConstraints);
            jButton2.setIcon(new javax.swing.ImageIcon(
                             //"images/T3.gif"));
                             "card game implementation/Nigat/newgame1.jpg"));
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 1;
            gridBagConstraints.gridy = 1;
            gridBagConstraints.ipadx = -39;
            gridBagConstraints.ipady = -12;
            gridBagConstraints.insets = new java.awt.Insets(213, 40, 0, 40);
            jPanel1.add(jButton2, gridBagConstraints);
            jButton3.setIcon(new javax.swing.ImageIcon(
                             //"images/T4.gif"));
                             "card game implementation/Nigat/quit1.jpg"));
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 1;
            gridBagConstraints.gridy = 2;
            gridBagConstraints.ipadx = -39;
            gridBagConstraints.ipady = -12;
            gridBagConstraints.insets = new java.awt.Insets(80, 40, 70, 40);
            jPanel1.add(jButton3, gridBagConstraints);
            jPanel2.setLayout(new java.awt.GridBagLayout());
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 1;
            gridBagConstraints.gridheight = 2;
            gridBagConstraints.ipadx = 420;
            gridBagConstraints.ipady = 400;
            gridBagConstraints.insets = new java.awt.Insets(43, 60, 40, 0);
            jPanel1.add(jPanel2, gridBagConstraints);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 1);
            getContentPane().add(jPanel1, gridBagConstraints);
            pack();
        /** 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 CardTest().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JPanel jPanel1;
        private javax.swing.JPanel jPanel2;
        // End of variables declaration
    }

  • Adding background and border with dropshadow to website

    Hi all,
    I have been working on my first website ever and I am sure I made several mistakes.
    I want to improve the look now and would like to add a gradient background (dark blue to light blue). To set the content apart from this I would like to add a white border around it with a dropshadow. I can see how to add the background, but I cannot figure out the border and dropshadow. Can anyone help? Below is the code.
    Thank you so much in advance—I am struggeling....
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>PetsWest Pet Supplies and Dog Training - Home</title>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <link href="CSS/PW.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    body {
              background-color: #CCC;
    body,td,th {
              color: #FFF;
              font-size: 14px;
    </style>
    </head>
    <body>
    <div id="content"> <img src="images/Indexheader.png" width="860" height="200" alt="Indexheader" />
      <ul id="MenuBar1" class="MenuBarHorizontal">
        <li><a href="Index.html" title="Home">Home</a>    </li>
        <li><a href="UnderConstruction.html" class="MenuBarItemSubmenu">Retail Store</a>
          <ul>
            <li><a href="UnderConstruction.html">Food</a></li>
            <li><a href="UnderConstruction.html">Supplements</a></li>
            <li><a href="UnderConstruction.html">Health Care</a></li>
            <li><a href="UnderConstruction.html">Toys</a></li>
            <li><a href="UnderConstruction.html">Supplies</a></li>
            <li><a href="UnderConstruction.html">Accessories</a></li>
          </ul>
        </li>
        <li><a class="MenuBarItemSubmenu" href="UnderConstruction.html">Training</a>
          <ul>
            <li><a href="UnderConstruction.html">Facility</a>        </li>
            <li><a href="UnderConstruction.html">Classes</a></li>
            <li><a href="UnderConstruction.html">Instructors</a></li>
          </ul>
        </li>
        <li><a href="LJBates.html" class="MenuBarItemSubmenu">Rehab Center</a>
          <ul>
            <li><a href="UnderConstruction.html">Therapy</a></li>
            <li><a href="UnderConstruction.html">Conditioning</a></li>
            <li><a href="LJBatson.html">L.J. Batson</a></li>
          </ul>
        </li>
        <li><a href="DogWash.html">Dog Wash</a></li>
        <li><a href="http://www.my.calendars.net/petswestcal" target="_blank">Events</a>    </li>
        <li><a href="ContactUs.html">Contact Us</a></li>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="860" height="398" align="left" id="FlashID" title="Indeximages">
          <param name="movie" value="Assets/PWIndeximages.swf" />
          <param name="quality" value="high" />
          <param name="wmode" value="opaque" />
          <param name="swfversion" value="6.0.65.0" />
          <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
          <param name="expressinstall" value="Scripts/expressInstall.swf" />
          <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
          <!--[if !IE]>-->
          <object data="Assets/PWIndeximages.swf" type="application/x-shockwave-flash" width="860" height="398" align="left">
            <!--<![endif]-->
            <param name="quality" value="high" />
            <param name="wmode" value="opaque" />
            <param name="swfversion" value="6.0.65.0" />
            <param name="expressinstall" value="Scripts/expressInstall.swf" />
            <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
            <div>
              <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
              <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
            </div>
            <!--[if !IE]>-->
          </object>
          <!--<![endif]-->
        </object>
      </ul>
       <ul class="store">STORE HOURS: Monday – Thursday 9:00AM – 9:00PM Friday &amp; Saturday 9:00AM – 7:00PM Sunday - Closed</ul>
    <p class="PW.css"><img src="images/announcement215x315px.png" alt="Announcementbox" width="215" height="315" align="left" /></p>
      <p class="introcopy"><span class="introheader"><span id="introhead">PetsWest takes a proactive approach</span><br />
      </span><span class="introcopy"><span class="introcopy">to canine wellness that provides the <font color="#000"><b>nutritional</b></font>, <font color="#000"><b>exercise</b></font> and <font color="#000"><b><br />
      treatments</b></font> that best accommodate each dog’s specific needs.<br />
      Whether you have an older dog suffering from<br />
        geriatric ailments, an injured dog that needs short or long term<br />
        therapeutic treatments, or a <font color="#000"><b>performance dog</b></font> whose success<br />
        requires staying fit and trim, the Center offers the right<br />
        combination of professional advice, hands-on <br />
        therapies and nutritional guidance to help you and <br />
      your pet reach your goals.</span></span>  </p>
      <p class="copyrightcopy">Copyright 2011 PetsWest Pet Supplies and Dog Training ::  102 Bearcat Road Aledo, TX  ::  Tel. 817 441 6881 <br />
    ALL RIGHTS RESERVED. ALL TRADEMARKS ACKNOWLEDGED.</span></span></p>
    </div>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    swfobject.registerObject("FlashID");
    </script>
    </body>
    </html>

    #1 Remove this embedded CSS code from your HTML document(s).  You don't need it.
    body {
        background-color: #CCC;
    body,td,th {
        color: #FFF;
        font-size: 14px;
    #2 Open  PW.css file and add this to the top:
    body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    background-color: #CADFEB;
    /**or insert a background-image using the CSS editor**/
    #3 Remove font-family and font-size from all your other CSS selectors.  You don't need to duplicate styles on every element. 
    #4 Replace this:
    #content {
        position:absolute;
        left:199px;
        top:10px;
        width:860px;
        z-index:1;
        right: auto;
        background-color: #FFF;
        text-align: center;
        color: #000;
        height: auto;
    with this:
    #content {
         width:860px;
         margin: 20px auto;
         border: 4px solid silver;
         background-color: #FFF;
         text-align: center;
         color: #000;
         -moz-box-shadow: 5px 5px 5px #888;
         -webkit-box-shadow: 5px 5px 5px #888;
         box-shadow: 5px 5px 5px #888;
    #5 Save your PW.css file and upload to server.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

Maybe you are looking for