"relative" positioning of buttons in a JFrame

I want to draw an image as a background on a JFrame and then position several buttons in the frame such that when the frame is resized, the background is resized and the buttons remain "over" the same thing in the background image. I've tried to "do the right thing" and use a layout manager to position the buttons, but they just don't seem to behave like I need them to.
Is there an easy way to get a button to appear at e.g. 70% horizontally across the frame and 40% down the frame? And then when I resize, have the button still be 70% across and 40% down (based on the new size of the frame). Or should I just give up on the layout managers, and calculate my own absolute positions for everything?
Thanks

Check this out:
import javax.swing.*;
import java.awt.*;
public class CompassButtons extends JFrame {
  JButton nb = new JButton("North");
  JButton sb = new JButton("South");
  JButton eb = new JButton("East");
  JButton wb = new JButton("West");
  JViewport viewport = new JViewport();
  public CompassButtons() {
    super("SpringLayout Compass Demo");
    setSize(500,300);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    SpringLayout sl = new SpringLayout();
    Container c = getContentPane();
    c.setLayout(sl);
    int offset = 50;  // gap between buttons and outside edge
    int w      = 80;  // width of buttons
    int h      = 26;  // height of buttons
    int border =  3;  // border around viewport
    Spring offsetS     = Spring.constant(offset);
    Spring borderS     = Spring.constant(border);
    Spring widthS      = Spring.constant(w);
    Spring halfWidthS  = FractionSpring.half(widthS);
    Spring heightS     = Spring.constant(h);
    Spring halfHeightS = FractionSpring.half(heightS);
    Spring leftEdgeS   = sl.getConstraint(SpringLayout.WEST, c);
    Spring topEdgeS    = sl.getConstraint(SpringLayout.NORTH, c);
    Spring rightEdgeS  = sl.getConstraint(SpringLayout.EAST, c);
    Spring bottomEdgeS = sl.getConstraint(SpringLayout.SOUTH, c);
    Spring xCenterS    = FractionSpring.half(rightEdgeS);
    Spring yCenterS    = FractionSpring.half(bottomEdgeS);
    Spring leftBorder  = Spring.sum(leftEdgeS, borderS);
    Spring topBorder   = Spring.sum(topEdgeS, borderS);
    Spring northX = Spring.sum(xCenterS, Spring.minus(halfWidthS));
    Spring southY = Spring.sum(bottomEdgeS, Spring.minus(Spring.sum(heightS,
                                                                    offsetS)));
    Spring eastX = Spring.sum(rightEdgeS, Spring.minus(Spring.sum(widthS,
                                                                  offsetS)));
    Spring eastY = Spring.sum(yCenterS, Spring.minus(halfHeightS));
    c.add(nb, new SpringLayout.Constraints(northX, offsetS, widthS, heightS));
    c.add(sb, new SpringLayout.Constraints(northX, southY, widthS, heightS));
    c.add(wb);
    sl.getConstraints(wb).setX(offsetS);
    sl.getConstraints(wb).setY(eastY);
    sl.getConstraints(wb).setWidth(widthS);
    sl.getConstraints(wb).setHeight(heightS);
    c.add(eb);
    sl.getConstraints(eb).setX(eastX);
    sl.getConstraints(eb).setY(eastY);
    sl.getConstraints(eb).setWidth(widthS);
    sl.getConstraints(eb).setHeight(heightS);
    c.add(viewport); // this sets a bounds of (0,0,pref_width,pref_height)
    // The order here is important...need to have a valid width and height
    // in place before binding the (x,y) location
    sl.putConstraint(SpringLayout.SOUTH, viewport, Spring.minus(borderS),
                     SpringLayout.SOUTH, c);
    sl.putConstraint(SpringLayout.EAST, viewport, Spring.minus(borderS),
                     SpringLayout.EAST, c);
    sl.putConstraint(SpringLayout.NORTH, viewport, topBorder,
                     SpringLayout.NORTH, c);
    sl.putConstraint(SpringLayout.WEST, viewport, leftBorder,
                     SpringLayout.WEST, c);
    ImageIcon icon = new ImageIcon("images/terrain.jpg");
    viewport.setView(new JLabel(icon));
    // Hook up the buttons.  See the CompassScroller class (on-line) for details
    // on controlling the viewport.
    nb.setActionCommand(CompassScroller.NORTH);
    sb.setActionCommand(CompassScroller.SOUTH);
    wb.setActionCommand(CompassScroller.WEST);
    eb.setActionCommand(CompassScroller.EAST);
    CompassScroller scroller = new CompassScroller(viewport);
    nb.addActionListener(scroller);
    sb.addActionListener(scroller);
    eb.addActionListener(scroller);
    wb.addActionListener(scroller);
    setVisible(true);
  public static void main(String args[]) {
    new CompassButtons();
}Copyright 2003, O'Reilly & Associates
Provided as example.
Cheer
DB

Similar Messages

  • Font Smoothing + Relative Positioning = Problem

    Hello,
    I ran across a strange inconsistency while designing a relative position based layout.
    My page has two divs, both relative positioned for height. They do not overlap. The page renders excellent in Firefox 3.5, and not bad in Chrome (though a little different from FF). Safari however pushes my second div down too far.
    I found that by disabling font smoothing (or rather switching it to anything besides "windows standard") fixes this issue. However there isn't even any actual text on the site, at all. There's 4 images, a couple input fields and a submit button.
    I can post some of the code, or example screenshots of what's happening. I've tried a couple css hacks to target safari (without targeting chrome) with no success. Anybody have any advice?
    Thanks,
    Tom

    Please disreard...
    I got it figured out. I just moved the paragraph tag outside
    of the table
    and changed the position from bottom:50% to top:50%
    once the <p> was moved out of the table, it's normal
    position would be at
    the very top. So, I moved it 50% down from the top using
    relative
    positioning. Being inside the table caused it to not work in
    Gecko? I
    wonder why?
    "-D-" <[email protected]> wrote in message
    news:f7fr0d$jb8$[email protected]..
    > I'm using relative positioning for an <p> tag that
    is positioned normally
    > at the bottom of a table cell "valign="bottom".
    >
    > I set the paragraph tag to <p
    >
    style="position:relative;bottom:50%;text-align:center;line-height:1.6em;">
    >
    > so, the text will position itself 50% from the bottom
    positioning. This
    > works fine in IE, but Mozilla and Netscape still
    position the text at the
    > bottom of the table cell.
    >
    > Here is the test page to see what is happening:
    >
    http://www.dwayneepps.com/contact.aspx
    >
    > fill out the form and click send to see the problem.
    >
    > Thanks for any help.
    >

  • How to position two buttons on top of div element inside a div container?

    Hello!
    Good news...
    I have created my very first thumbnail slider for my website that actually works!
    Bad news...
    The buttons that help scroll the div element, which is wrapped inside a center container, are no longer positioned on top of the div.
    Here is the html:
    <div id="centerContainer">
    <div id="aemcSlider">
       <ul>
        <li>
            <a class="aemcPkgBut" href="" target="" alt="AEMC Packaging" title="AEMC Packaging"> </a>
            </li>
            <li>
             <a class="aemcGroundFlexBut" href="" target="" alt="GroundFlexAd" title="GroundFlex Ad"> </a>
             </li>
         <li>
          <a class="aemcClampBut" href="" target="" alt="Clamp-On Ad" title="Clamp-On Ad"> </a>
          </li>
              <li>
              <a class="aemcMetrixBut" href="" target="" alt="Metrix Ad" title="Metrix Ad"> </a>
              </li>
         </ul>
    </div>
    <div id="leftBut">
    <a class="arrowLeft" href="" target="" alt="Left" title="Left"> </a>
    </div>
    <div id="rightBut">
    <a class="arrowRight" href="" target="" alt="Right" title="Right"> </a>
    </div>
    </div>
    Here is the CSS:
    Main container:
    #centerContainer
    {width: 800px; margin: 0 auto; background-color:#0e210e; position:relative}
    Div Element:
    #aemcSlider
        text-align:center;
        list-style:none;
        width: 450px;
        height: 114px;
        margin: 0 auto;
        padding-top: 0px;
        padding-right: 0px;
        padding-bottom: 0px;
        padding-left: 0px;
        top: 67px;
        position: relative;
        overflow: hidden;
    #aemcSlider a {margin-right: -12px;}
    Left & Right Buttons:
    a.arrowLeft
        width: 29px;
        height: 96px;
        float:left;
        position:absolute;
        margin: 0 auto;
        display: block;
        background-image: url(../Images/arrowLeft.png);
        background-repeat: no-repeat;
        left: 311px;
        top: 91px;
        opacity: 0;
    a.arrowLeft:hover
    background-image: url(../Images/arrowLeft.png);
    opacity: 0.5;
    a.arrowRight
        width: 29px;
        height: 96px;
        position:absolute;
        float:right;
        margin: 0 auto;
        display: block;
        background-image: url(../Images/arrowRight.png);
        background-repeat: no-repeat;
        opacity: 0;
        left: 720px;
        top: 92px;
    a.arrowRight:hover
    background-image: url(../Images/arrowRight.png);
    opacity: 0.5;
    Here are the things I've done to troubleshoot:
    If I put the div element as an absolute container, the left button disapears.
    I get the same effect when I change the position to relative.
    I tried changing the position to relative for both buttons.
    I also tried to position the buttons outside the Main Div container and no go.
    How can I position the relative div element under these controller button?
    Any help would be muchly appreciated.
    ~LA

    OK,
    Got the site onto a public web space.
    Here sre the links...
    http://www.aliciaalmeidagraphicdesigner.com/Work.html
    http://www.aliciaalmeidagraphicdesigner.com/style/Body.css
    http://www.aliciaalmeidagraphicdesigner.com/js/functions.js
    Anyone can help me out, please?
    Thanks!
    LA
    PS: Dissapointed...my website looks much better from my local file than remote

  • Position a button

    how come when i compile, it says :
    :\Documents and Settings\Tang\Desktop\Grid.java:22: cannot find symbol
    symbol : class Position
    location: class Grid
              container.add (button , new Position (0,0) ) ;
    how do i position a button???
    import javax.swing.* ;
    import java.awt.*;
    class Grid extends JFrame
         public static void main (String args [])
              Grid grid = new Grid ();
         public Grid ()
              init() ;
         public void init()
              JFrame frame = new JFrame() ;
              Container container = frame.getContentPane() ;
              container.setLayout (new GridLayout (3,3)) ;
              JButton button = new JButton ("BUTTON1") ;
              container.add (button ,new Position (0,0) ) ;
    }

    There's JavaDoc for Position:
    * Represents a location within a document. It is intended to abstract away
    * implementation details of the document and enable specification of
    * positions within the document that are capable of tracking of change as
    * the document is edited (i.e. offsets are fragile).
    Where the hell is there any word about GridLayout?
    If You want to add to GdidLayout at a given position, you have to select the index of a Component:
    0 | 1 | 2
    3 | 4 | 5
    6 | 7 | 8
    so if you want to add it into center grid:
    add(button,4)

  • Position of buttons as3

    I need some help with Positions of buttons in AS3. I made a IRC client with AS3, but when a user join a channel, there will be a button added, but if there is already a button and the user join new channel on IRC, there will be added new button also, this for every channel that a user does join, but It should to be positioned after the last button (side by side). Same for if a user join more channels. How can i do this on best way with x and y positions? Ofcourse, it must check first if there is already button on the position if a user did join channel.
    This is my code for now:
    const PADDING:uint = 10;
    const NUM_BUTTONS:uint = 10;
    onChannelButton();
    function onChannelButton():void {
        var test:Sprite = new Sprite();
        var btn:Button;
        //NUM_BUTTONS or btn.length ?
        for (var i:int = 0; i < NUM_BUTTONS; i++)
                btn = new Button();
                btn.name = "btn";
                btn.width = 90;
                btn.x = (btn.width + PADDING) * i;
                test.addChild(btn);
        addChild(test);
    Example how to do: http://oi42.tinypic.com/j5cl0i.jpg
    Thanks!

    var btn_parent:Spirte=new Sprite();
    btn_parent.name="btn_parent";
    MovieClip(root).addChild(btn_parent);
    // whenever you add a btn:
    const COLNUM:int = 25;
    const PADDING:uint = 10;
    const NUM_BUTTONS:uint = 10;
    onChannelButton();
    function onChannelButton():void {
        var btn:Button;
        //NUM_BUTTONS or btn.length ?
        for (var i:int = 0; i < NUM_BUTTONS; i++)
                btn = new Button();
                btn.name = "btn";
                btn.width = 90;
    positionF(btn);
               btn_parent.addChild(btn);
    function positionF(btn:Button):void{
    btn.x = (btn_parent.numChildren%COLNUM)*(btn.width+PADDING));
    btn.y = Math.floor(btn_parent.numChildren/COLNUM)*(btn.height+PADDING);

  • White space below footer due to Relative Positioning?

    I'm pretty new to coding. I'm learning how to do a responsive website and everything is working, EXCEPT for the huge blank space below the footer at the largest screen resolution. I know it is because of the relative positioning I used for the "samples" section. I know this question has been asked before. I've tried the suggestions, but cannot seem to get it to work. I cannot figure out a way to accomplish having the "samples" section at the spot I want without using relative positioning. I've tried "float" to no avail.
    Everything is working, except for the huge space below the footer at the largest screen size for my responsive page.
    Instead of pasting my .html and 3 .css files here, here is my site of which you can right click and "view page source" to get all the code. Don't want to make my question look too long!
    Here: grc198.orijenaldesigns.com
    Any help would be much appreciated!

    Hi,
    Please share the URL of the web site.
    Regards,
    Abhishek Maurya

  • Do I understand AP Divs & relative positioning?

    Hello.
    So to cut a long story short....
    I am newbie & plunged into creating my first website using all AP elements, only to find out that this is not a good way because of the nature of the AP's.
    After much help from this forum (PZ in particular) I decided to do my research a little bit more.
    I still have to create another website that I guess should really be built in flash (as suggested by someone). But as I dont know Flash this is not an option. (please see attached design concept).
    The only elements I really need at this point would be for the "get a quote" & "about", "contact" bubbles to have rollover states that change colour when the mouse goes over them.
    I have been trying to find the best way of doing this without AP elements.
    1) Create a Div container with the main image for the background, then insert a table and try to insert the rollover images that way. But after research, I am finding that I should be steering away from tables and moving towards CSS. Which then led me to Idea no 2.
    2) Create a Div container with the main image for the background, then insert Div's and adjust the margins (relative positioning?) to move to the Divs in correct places I need the rollovers. But again I read that this method should only be done for tweaking a web page and not  structuring a webpage as may cause problems.
    3) Create a Div container with the main image for the background, then insert Div's in a grid like system (see attached image of my guides where I would place Div's), But this seems a over complicated way to do it and you end up with divs that have no use & lots of unwanted code.
    OR am I right in thinking this works?
    4) Apply a relative positioned Div, set background image, then place AP div's inside RP Div that I would use for my rollovers? If I did this would this then avoid the problem of the AP divs moving in different browsers?
    Or have I got this all completely wrong and have to go back to the drawing board again?
    Your thoughts would be appreciated :-)
    Many thanks in advance
    Louisa

    Build your HTML content logically from top of page to bottom of page.  Use default CSS positioning (which is no positioning at all) for the majority of your page layout.
    Use AP Divs only when absolutely necessary because doing so removes them from normal content flow.
    To control APDivs in relation to other content on the page, you many need to wrap them inside a relatively positioned container.
    Example of APDivs inside a Relatively positioned container:
    http://alt-web.com/DEMOS/CSS-Disjointed-Menu-Rollover.shtml
    As far as your design concept goes, you could do this a number of ways.  With CSS sprites or an Image Map, for example.
    http://alt-web.com/DEMOS/CSS-Sprites.shtml
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • Bug: Front Panel objects relative position change when placing merge VI onto Block Diagram

    I've posted a bug report on LAVA, here:
    http://forums.lavag.org/Front-Panel-objects-relati​ve-position-change-when-placing-merge-VI-onto-Bloc​...
    If someone at NI can reproduce, can I please get a CAR #?
    Thanks,
    -Jim
    Solved!
    Go to Solution.

    Donovan B wrote:
    Hi Jim,
    After my previous post, I also saw this behavior, so I decided to do another test.  If there are no decorations in the VI set to “Merge VI” (“Place VI Contents” for LabVIEW 8.5 and later) the controls and indicators are still not selected when dropping the VI from the Functions palette.  I checked this behavior back to LabVIEW 7.1 and it is consistent throughout that controls and indicators are not selected.  (Consequently, so is the fact that when decorations are present they don’t maintain the relative position).
    I am not sure if this would be better suited as a CAR or product suggestion since it has been this way that long, but it does not appear to be related to the fact that decorations are present in the Merge VI.  It does seem strange that the decorations are selected though.  Looks like the best way to work around this is to drop the VI from the Controls palette.  Hopefully, it’s not too much of a hassle.
    Hi  Donovan,
    Thanks for checking in.
    >  I checked this behavior back to LabVIEW 7.1 and it
    is consistent throughout that controls and indicators are not
    selected.  (Consequently, so is the fact that when decorations are
    present they don’t maintain the relative position).
    This just means that not many people use this feature.  However, now that VIPM Professional makes it so easy to edit the palettes, I'm sure that others will start complaining that this doesn't work as they expect.
    > I am not sure if this would be better suited as a CAR or product suggestion
    since it has been this way that long, but it does not appear to be
    related to the fact that decorations are present in the Merge VI.
     Just look up the functional specifications for this feature and see if all objects are supposed to be selected.
    But seriously, is there a reason that only the FP decorations are selected?  Surely this would be documented somewhere, if there was a good reason for this current (IMO, buggy) behavior.
    > It
    does seem strange that the decorations are selected though.  Looks like
    the best way to work around this is to drop the VI from the Controls
    palette.  Hopefully, it’s not too much of a hassle.
    That's not a reasonably work-around, IMO.  It doesn't make sense to drop Block Diagram components onto the Front Panel.  For example, this bug affects the JKI State Machine.  It doesn't make sense to drop a State Machine onto the Front Panel.
    So, I'd file it as a CAR/bug, and then wait to see how LV R&D feels about it.  If they can find some valid reason for why Controls and Indicators shouldn't be selected, then that's fine (and hopefully someone will explain it to me).
    Thanks,
    -Jim

  • Relative position of dock icons cannot be changed by dragging.

    I have just moved from Tiger to Leopard and am trying to reorganize the dock I inherited from the older OS. In particular, I wish to change the relative positions of the icons. The old (Tiger) method of drag and drop didn't work ... any icon I try to move always snaps back into its former position when I release it. This happens in both the applications and folder categories on the dock.
    I consulted the documentation for Leopard and it describes the same old way of moving icons as with Tiger. Clearly this simply does not work. I searched this forum with "dock icon" and didn't find any discussion of this phenomenon.
    It looks like a bug. Has anyone else encountered this?

    Hi Norman,
    Try moving your mouse down when you're shifting icons. I find that if you keep your cursor at the level of the other icons (as opposed to below them), the icons won't shift aside. You could also try pulling the Dock icon you're trying to move out of the Dock region and putting it back in at the new place. It's not the most intuitive of behavior, I know.
    Hope that helps!
    —Hazy

  • Relative position of splitter in panelSplitter

    Hi.
    I wount to set the splitterPosition in panelSplitter to a relative value, e.g. 50%.
    I see that only an integer value is possible for this attribute.
    Is it possible to achieve a relative position to the availabe space on the screen?
    I need it also for the case the web browser window is resized and the splitters should be moved relativelly to the new available screen size.
    Best regards.
    Paul.

    Hmmmm... That's not working either.
    Inserting this expression into an Effect's point control doesn't put it in the right position.  I tried inserting this expression into another (2D) null's position, but it's in the same incorrect place.
    Original Null A Position (from C4D project import).  This comp is put into Comp ZZ.
    Applying that Expression to Null's position in Comp ZZ puts the new Null B way off in the corner.

  • Relative positioning of two cross tabs.

    I have two cross tabs. The first one is dynamic as the number of columns change based on user prompts. The second cross tab is fixed one column which is attached as the last column to the first cross tab.
    When the columns of first cross tabs change, the second cross tabs column doesnot move across to fit as a last column i.e., there is no relative positioning between the cross tabs..
    How do we achieve this? Any help would be greatly appreciated.
    Thanks,
    Adam

    Right click on the section where the two crosstabs placed and go to section expert and check the option "Relative Positions"
    Regards,
    Raghavendra

  • Relative Positioning of Slices

    Why doesn't FW allow you to export your slices using relative
    positioning!? I might as well ignore the export css feature all
    together.
    I need to insert FW html into an already existing html
    document, but the absolute positing of the elements is causing me
    to have to hand code every individual slice. A major hassle.
    Is there something I'm missing? Does anyone have a quick way
    of modifying FW css to relative positioning?

    romeogq wrote:
    > Noooo, please don't be serious. That's basically what
    I've been doing... and
    > it's way too time consuming, especially when I could
    simply export using
    > tables. Just trying to figure out the simplest way to
    export to css with
    > relative positioning. My graphic has about 40 slices,
    hence I really do not
    > want to hand code.
    >
    Have you checked out the SMART CSS extension available on
    Adobe's web
    site? It may help.
    Jim Babbage - .:Community MX:. & .:Adobe Community
    Expert:.
    Extending Knowledge, Daily
    http://www.communityMX.com/
    CommunityMX - Free Resources:
    http://www.communitymx.com/free.cfm
    .:Adobe Community Expert for Fireworks:.
    news://forums.macromedia.com/macromedia.fireworks
    news://forums.macromedia.com/macromedia.dreamweaver

  • Problems with relative positioning divs

    Hi all,
    I'm still new to this css layouts thing, but am stumped by this problem. I have numerous parent divs with multiple child divs within them on my page design, and for some reason these child divs are not taking up the correct spacing that I enter in the CSS. They are all relative positioned, mostly using floats and clears (and I don't think I've missed any of those). Help! Hoping that it's something simple I've missed.
    To pinpoint one example of this recurring problem, the #sidenav_one div will float: left with a spacing of top 8px and left 8px, but then #sidenav_two refuses to float: left, clear: both with a spacing of top 8px (I've had to put in 16px to actually get 8px, in both Firefox, Safari and Opera). (relevant parts of code highlighted).
    I am happy to change how I've structured the page, if people think there is a better or cleaner way to do it. Thanks in advance.
    A
    <!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>United Future Foundation</title>
    <style type="text/css">
    <!--
    #container {
        position:absolute;
        left:517px;
        top:15px;
        width:972px;
        height:auto;
        z-index:1;
        background-color: #999;
        margin-left: -461px;
        padding-bottom: 25px;
    #banner {
        position:relative;
        width:872px;
        height:210px;
        z-index:2;
        background-color: #FFF;
        float: left;
        left: 50px;
        top: 15px;
        color: #999; 
    #banner_left { 
        position:relative; 
        width:450px; 
        height:70px; 
        z-index:2; 
        float: left; 
        left: 5px; 
        top: 5px; 
    #banner_right { 
        position:relative; 
        width:208px; 
        height:200px; 
        z-index:2; 
        float: right; 
        top: 5px; 
        right: 5px; 
    #banner_name { 
        position:relative; 
        width:550px; 
        height:140px; 
        z-index:2; 
        clear: left; 
        float: left; 
        left: 5px; 
    .rounded { 
        -moz-border-radius:5px; 
        -webkit-border-radius:5px; 
    body { 
        font-family: "Myriad Pro", "Helvetica Neue", sans-serif; 
    p { 
        font-family: "Myriad Pro", "Helvetica Neue", sans-serif; 
        font-size: 14px; 
        color: #000; 
    h1 { 
        font-size: 16px; 
        color: #000; 
        text-align: center; 
        vertical-align: top; 
    h2 { 
        font-size: 20px; 
        color: #000; 
        text-align: left; 
    #content { 
        position:relative; 
        left:50px; 
        width:872px; 
        height:auto; 
        z-index:2; 
        clear: both; 
        float: left; 
        background-color: #FFF; 
        top: 20px; 
    #sidenav_one {
        position:relative;
        left:8px;
        top:8px;
        width:136px;
        height:44px;
        z-index:2;
        background-color: #999;
        float: left;
        overflow: hidden;
    #sidenav_two {
        position:relative;
        left:8px;
        top:16px;
        width:136px;
        height:44px;
        z-index:2;
        background-color: #999;
        float: left;
        overflow: hidden;
        clear: left;
    #sidenav_three { 
        position:relative; 
        left:8px; 
        top:24px; 
        width:136px; 
        height:44px; 
        z-index:2; 
        background-color: #999; 
        clear: left; 
        float: left; 
        overflow: hidden; 
    #text { 
        position:relative; 
        top:8px; 
        width:700px; 
        height:auto; 
        z-index:2; 
        background-color: #FFF; 
        float: right; 
        right: 14px; 
    #home_home { 
        position:relative; 
        width:250px; 
        height:188px; 
        z-index:3; 
        clear: both; 
        float: left; 
        top: 10px; 
        left: 31px; 
    #home_about { 
        position:relative; 
        left:30px; 
        width:250px; 
        height:188px; 
        z-index:2; 
        float: left; 
        top: 10px; 
    #home_events { 
        float: left; 
        height: 188px; 
        width: 250px; 
        position: relative; 
        left: 30px; 
        top: 10px; 
    -->
    </style>
    <script type="text/JavaScript" src="curvycorners.js"></script>
    <script type="text/JavaScript">
    window.onload = function() {
        var settings = {
          tl: { radius: 5 },
          tr: { radius: 5 },
          bl: { radius: 5 },
          br: { radius: 5 },
          antiAlias: true
        var divObj = document.getElementById(".rounded"); 
        curvyCorners(settings, divObj);
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    </script>
    </head> 
    <body onload="MM_preloadImages('images/news_down.jpg','images/about_down.jpg','images/what_up.j pg','images/who_down.jpg','images/support_down.jpg','images/contact_down.jpg')">
    <div class="rounded" id="container">
    <div class="rounded" id="banner">
    <div id="banner_left"><img src="banner_uff.jpg" width="450" height="70" /></div>
    <div id="banner_right"><img src="ufflogo.jpg" width="208" height="200" /></div>
    <div id="banner_name"><img src="banner_name.gif" width="509" height="133" /></div>
    </div>
    <div id="spot">you are here</div>
    <div class="rounded" id="content">
    <div id="text">
    <h2> Breaking the Cycle - United Future Foundation</h2>
    <p>United Future Foundation is an Australian non-government organisation operating in Uganda. UFF is “breaking the cycle” through education. We believe that education is the primary means of creating lasting change, increasing literacy and improving employment. UFF is building a combined primary school and vocational training centre for over 300 students in the Kasanje region of Uganda. </p>
    <p>United Future Foundation is focussed on facilitating access to education and skills training for disadvantaged youth in poverty stricken and remote areas of Uganda. We strongly believe that education is the first and foremost method to break the cycle of illiteracy, ill health and lack of opportunities. </p>
    </div>
    <div class="rounded" id="sidenav_one">
        <h1>News</h1>
    </div>
    <div class="rounded" id="sidenav_two">
      <h1>Press Releases</h1>
    </div>
    <div class="rounded" id="sidenav_three">
        <h1>Media</h1>
    </div>
    <div id="home_home"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','images/news_down.jpg',1)"><img src="images/news_up.jpg" name="home" width="250" height="188" border="0" id="home" /></a></div>
    <div id="home_about"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('about','','images/about_down.jpg',1)"><img src="images/about_up.jpg" name="about" width="250" height="188" border="0" id="about" /></a></div>
    <div id="home_events"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('events','','images/what_up.jpg',1)"><img src="images/what_down.jpg" name="events" width="250" height="188" border="0" id="events" /></a> </div>
    </div>
    </div>
    </body>
    </html>

    This is much simpler than you would think. You're making it hard work for yourself because you believe css is much more comlex than it really is or need be.
    You rarely need to use relative positioning at all. You are using too many <divs> and redundant css attributes to reach your goals.
    Think of the web as a simple structure of boxes and ino those boxes you place html tags or 'when' needed other <divs> ('when' is the choice word here. In time you will know when and when not to)
    Copy the css and page code below and paste into a new Dreamweaver document. See how much leaner and cleaner the css and html code is.
    <!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>Untitled Document</title>
    <style type="text/css">
    body {
    font-family: "Myriad Pro", "Helvetica Neue", sans-serif;
    p {
    font-family: "Myriad Pro", "Helvetica Neue", sans-serif;
    font-size: 14px;
    color: #000;
    .rounded {
    -moz-border-radius:5px;
    -webkit-border-radius:5px;
    #spot {
    text-align: right;
    #container {
    margin: 0 auto; /* horizontally centers container which has a width */
    margin-top: 15px;
    width: 972px;
    background-color: #999;
    padding-bottom: 25px;
    overflow: hidden; /* a method to clear floated containers within a parent container */
    #banner {
    width: 872px;
    height:210px;
    background-color: #FFF;
    margin: 0 auto; /* horizontally centers container which has a width */
    margin-top: 15px;
    color: #999;
    #banner_left {
    width:509px;
    float: left;
    margin-left: 5px;
    margin-top: 5px;
    #banner_right {
    width:208px;
    height:200px;
    float: right;
    margin-right: 5px;
    margin-top: 5px;
    #banner_name {
    position:relative;
    width:550px;
    height:140px;
    clear: both;
    margin-left: 5px;
    #content {
    margin: 0 auto; /* horizontally centers container which has a width */
    width:872px;
    background-color: #FFF;
    margin-top: 20px;
    overflow: hidden; /* a method to clear floated containers within a parent container */
    #sidenav {
    margin-left:8px;
    margin-top:8px;
    width:136px;
    float: left;
    h1 {
    font-size: 16px;
    color: #000;
    text-align: center;
    background-color: #999;
    padding: 10px 0 10px 0; /* short hand for top/right/bottom/left */
    margin: 0 0 6px 0; /* short hand for top/right/bottom/left */
    #text {
    margin: 8px 0 0 18px; /* short hand for top/right/bottom/left */
    width:700px;
    background-color: #FFF;
    float: left;
    #home_home {
    width:750px;
    height:188px;
    clear: both;
    margin: 10px 0 0 31px; /* short hand for top/right/bottom/left */
    #home_home img {
    float: left;
    </style>
    </head>
    <body>
    <div class="rounded" id="container">
    <div id="spot">you are here</div>
    <div class="rounded" id="banner">
    <div id="banner_left"><img src="banner_uff.jpg" width="450" height="70" /><img src="banner_name.gif" width="509" height="133" /></div><!-- end banner left -->
    <div id="banner_right"><img src="ufflogo.jpg" width="208" height="200" /></div><!-- end banner right -->
    </div><!-- end banner -->
    <div class="rounded" id="content">
    <div class="rounded" id="sidenav">
        <h1>News</h1>
        <h1>Press Releases</h1>
        <h1>Media</h1>
    </div><!-- end sidnav -->
    <div id="text">
    <h2> Breaking the Cycle - United Future Foundation</h2>
    <p>United Future Foundation is an Australian non-government organisation operating in Uganda. UFF is “breaking the cycle” through education. We believe that education is the primary means of creating lasting change, increasing literacy and improving employment. UFF is building a combined primary school and vocational training centre for over 300 students in the Kasanje region of Uganda. </p>
    <p>United Future Foundation is focussed on facilitating access to education and skills training for disadvantaged youth in poverty stricken and remote areas of Uganda. We strongly believe that education is the first and foremost method to break the cycle of illiteracy, ill health and lack of opportunities. </p>
    </div><!-- end text -->
    </div><!-- end content -->
    <div id="home_home"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','images/news_down.jpg',1)"><img src="images/news_up.jpg" name="home" width="250" height="188" border="0" id="home" /></a>
    <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('about','','images/about_down.jpg',1)"><img src="images/about_up.jpg" name="about" width="250" height="188" border="0" id="about" /></a>
    <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('events','','images/what_up.jpg',1)"><img src="images/what_down.jpg" name="events" width="250" height="188" border="0" id="events" /></a>
    </div><!-- end home_home -->
    </div><!-- end container -->
    </body>
    </html>

  • Relate to CRM button Missing

    Hi all,
    I am currently installing Client based groupware integration on CRM 7.0 with outlook 2007. I have got must of up and running.
    But I am missing the "relate to CRM" button. It is nowhere to be found. Although the add-in is working in Outlook and I can trigger synchronization.
    Can anyone tell me what steps I am missing.?

    I would also check to see if the OEI Add-In is present and selected within Outlook. You may need to reselect it. If it is already selected you may need to manually register (they need to be present) the OEI DLL Files:
    regsvr32 "C:\Program Files\Siebel CRM OnDemand\Siebel OEI OnDemand\SiebelOnDemand.dll"
    regsvr32 "C:\Program Files\Siebel CRM OnDemand\Siebel OEI OnDemand\SiebelOnDemandEmail.dll"

  • Creating an array of buttons in a jframe

    hi, i need help im trying to create a simple button game where there are 5x3 buttons in a jframe where the user can click on one to find the button with the prize on it, i know how to create the jframe but im trying to approch this in a object orientated way, with classes not a procedural way, and having no luck, any suggestions?

    Ok, here what you want, but don't forget dukes:
    import java.awt.BorderLayout;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Random;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    public class MyGame extends JPanel{
        private Random rand ;
        private int rows;
        private int cols;
        private int prizeX;
        private int prizeY;
        public MyGame(int rows, int cols){
            //super(new GridLayout(rows, cols));
            super(new BorderLayout());
            this.rows = rows;
            this.cols = cols;
            JPanel p = new JPanel(new GridLayout(rows, cols));
            for (int i = 0; i < rows; i++) {
                for (int j = 0; j < cols; j++) {
                    JButton b =  new JButton(" Button [x="+i+", y="+j+"]");
                    b.addActionListener(new MyActionListener(i, j));
                    p.add(b);
            this.add(p, BorderLayout.CENTER);
            this.add(new MyReStartButton(), BorderLayout.SOUTH);
            rand = new Random(System.currentTimeMillis());
            prizeX = rand.nextInt(rows);
            prizeY = rand.nextInt(cols);
            System.out.println(prizeX+", "+prizeY);
        class MyActionListener implements ActionListener{
            private int x;
            private int y;
            public MyActionListener(int x, int y){
                this.x=x;
                this.y=y;
            public void actionPerformed(ActionEvent e) {
                if(x==prizeX&&y==prizeY){
                    JOptionPane.showMessageDialog(MyGame.this, " Winner !! ");
                }else{
                    JOptionPane.showMessageDialog(MyGame.this, " Try again ");
        class MyReStartButton extends JButton{
            public MyReStartButton(){
                super("Start new Game");
                addActionListener(new ActionListener(){
                    public void actionPerformed(ActionEvent e) {
                        MyGame.this.prizeX = rand.nextInt(rows);
                        MyGame.this.prizeY = rand.nextInt(cols);
                        System.out.println(prizeX+", "+prizeY);
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("MyGame");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            JComponent newContentPane = new MyGame(3, 5);
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setLayout(new BorderLayout());
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

Maybe you are looking for