Results 1 to 2 of 2

Thread: Java and CSS war

  1. #1
    Join Date
    Feb 2010
    Posts
    1

    Java and CSS war

    Hello,

    I'm trying to create a web banner that consists of (2) parts. The first is a static .gif image that is floated left. The second is a rotating image (called with Java), also floated, that is supposed to display in-line with the .gif image beside it.

    Everything works fine and displays correctly, including the random image, until I specify a link for the random image. If I include a link with the random image, the pic seems to ignore the float commands and instead jumps to the next line and displays below the gif.

    Here is how I coded the random image with link:

    var whichBanner = Math.round(Math.random()*(q-1));
    function showBanner(){
    document.write('<a href="http://www.google.com"<img src="'+theBanners[whichBanner]+'"></a>');
    }

    As soon as the <a href="... is removed, the image displays in the correct position (but without a link, obviously). What can I do?

    Much Thanks,
    B

  2. #2
    Join Date
    Apr 2009
    Posts
    569

    Re: Java and CSS war

    Now your image should be placed at the root of your project (with Eclipse for example, in the root folder of the project, not even in the source directory. I know that listening to the display of images in java is pretty boring ..
    the best things is to create a class that extends JPanel and override the method pain. Then you only need to create an instance of the class and include where you want the image to be displayed.

Similar Threads

  1. Replies: 4
    Last Post: 04-09-2013, 11:04 PM
  2. Setting Of Java to The Point At Manual Java
    By winni in forum Software Development
    Replies: 4
    Last Post: 10-01-2011, 10:05 PM
  3. Java Programming using Adventnet SNMP Java API
    By ROCKING_Suhas in forum Software Development
    Replies: 5
    Last Post: 17-07-2010, 06:52 AM
  4. Link List Example in Java Sample program in Java
    By trickson in forum Software Development
    Replies: 2
    Last Post: 04-08-2009, 08:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,907,495.04934 seconds with 17 queries