How to center an applet in the middle??

Hey,
I'm currently working on a design for a website and have some problems.
I can't find a way to center an applet on a screenresolution of 1024 x 768. Can anyone help me with this subject???
Anyway thanks in advance.
Lorcan

Just in case you want to do it Dynamicly and be able to put it any where you like
<html>
<head>
<script language ="javascript">
function move() {
/*U can change the var a,b to a diffrent number or what ever and move your applet where ever you like;*/
var a = (screen.width - 300) / 2; // this could be var a = 100;
var b = (screen.height - 300) / 2; //this could be var b = 200;
document.getElementById("dd").style.left = a;
document.getElementById("dd").style.top = b;
</script>
</head>
<body bgColor=blue  onload="move();">
<applet code="ball.class" width=300 height=300  ID="dd" style="position:absolute; "></applet>
</body>
</html>
GOOD LUCK

Similar Messages

  • How can I center my website to the middle? My website, not my writing if it helps understand it better

    I wanna center my website to the middle of the screen, not left align. My writing is centered on the website but the site I created is stuck in the left side.

    Hello,
    please try in your css advice:
    #main {
      width: ....px; /*(Your choice)*/
    margin: 0 auto;
    In German: Indem man die Breite (width) eines Block-Elements definiert, verhindert man, dass es sich nach rechts und links bis zum Rand des umgebenden Containers ausbreitet. Durch Setzen des rechten und linken Außenabstands (margin) auf auto lässt sich das Element horizontal zentrieren. Das Element nimmt so die definierte Breite an und teilt den verbleibenden Außenabstand gleichmäßig auf.
    My try in English:
    By the width (width) defines a block-level element, it prevents it from spreading to the right and left to the edge of the surrounding container. By setting the right and left outer distance (margin) to auto can be the element horizontally center. The element that accepts the defined width and divides the remaining outer spacing evenly.
    Hans-Günter
    P.S.
    Try also "margin: 0 auto;" alone.

  • How do i completly center my swf in the middle of the page?

    ok i made a flash, but it wont center to the middle of my page it centers horizontally on the top, but it wont vertically center to the middle of the page... what am i doing wrong? (please post a html fix for this problem with maybe a explaintaion with what i did wrong... sorry drunk)
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>intro2</title>
    </head>
    <body bgcolor="#000000">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!--
    100%
    100%
    100%
    100%
    100%
    100%
    100%
    100%
    100%
    100%
    100%
    100%
    100%
    100%
    100%
    -->
    <!-- saved from url=(0013)about:internet -->
    <p align="center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="500" height="281" id="intro2" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="intro2.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="intro2.swf" quality="high" bgcolor="#000000" width="500" height="281" name="intro2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    </p>
    </body>
    </html>

    Read through this: http://www.ddg-designs.com/howTo/FlashInAWindow/controllingSize.html It will explain how you can control the positioning of the .swf inside the browser window.

  • How to Start a color in the middle of a cell in the table & end in next cel

    Hai,
    I am developing a project in VB6 and the databse in MsAccess, i prepared the Report in HTML, Based on 2 Fields called Nextti & Duration Field I am coloring the Background of cells in the report table.
    Actually the Color should start and end insdie or outside the cell based on the 2 Field Values.
    Table is populated for 4 Years under that 48 months, therefor 2 row headings. 1 for showing Years in column & other for Months & with Some fields.
    the below is the line i use to change the background of a particular cell. Its done when i populate the data in the HTML Report.
    OutStream.WriteLine ("<td bgcolor=Yellow><P align=center><Font FACE=Tahoma size=1 color=black>" & Format(dtShade, "dd") & "</Font></P></td>")
    Now i am able to shade the Cell by giving its background color to yellow as below code
    but the problem is i am able to change the background of the full cell. But i don't need to change the background of the full cell always. For example if Nextti value is 15/1/2005 & Duration is 30 then the shade should start from the middle of January Cell (because of the date 15th)end in the middle of next cell (February). If the duration is 15 then it should end in the (January) same end of cell. Kindly tell me how can i do this through HTML. I heard Div can be used to solve this issue. I am a beginner so kindly any one give me a appropriate example which will suit to solve this issue.
    thankyou,
    Chock.

    Can you work out what the actual HTML is to do
    "Whatever it was that you wanted to do" ? { I couldn't understand that }
    I.e If you make up a Test table, with Your Text editor can you get a sample output that looks like you want?
    But the problem is i am able to change the background of the full cell. But i don't need to change the background of the full cell always. For example if Nextti value is 15/1/2005 & Duration is 30 then the shade should start from the middle of January Cell (because of the date 15th)end in the middle of next cell (February). If the duration is 15 then it should end in the (January) same end of cell.
    Is this something that can be done in HTML?
    If your question is 'amenable' to HTML, figure out conditions for which you want to Set a certain color....
    If the color in one cell for instance depends on the Next Cell, then you're going to have to buffer the whole Table ROW....
    Set which ones should be RED for instance, then output that ROW in HTML...
    If you are using Java for this, then also be aware that you might need to escape certain characters like use "\\" to get "\"
    You'd also probaly have an easier time, however you are doing this if you used some sort of CSS .......

  • Photoshop: how to put your page in the middle

    i've made my first page of my new website with photoshop cs2
    but i want to see it in the middle when i use IE or firefox
    how can i do that with dreamweaver
    my page
    thanks a lot

    Table height is invalid HTML.
    There is no align center option for an image.
    Your code will give horizontal but not vertical centering. To
    get valid,
    vertical centering, read this -
    http://www.apptools.com/examples/tableheight.php
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Pay Low Books!" <[email protected]> wrote
    in message
    news:f47f99$e9c$[email protected]..
    > Your page contains the photo only. Do you want to make
    the photo in the
    > middle?
    > Here is how to do it in Dreamweaver CS3:
    > Because your page looks like it contains many photos
    when I tried it in my
    > Dreamweaver, so you should select the whole image by the
    mouse. At the
    > bottom
    > of Dreamweaver, you will find properties window at the
    bottom.
    > You will find Align optin, choose Center from options
    beside it.
    > Another way, you can do it through HTML.
    > Using Dreamweaver, look at the code by selecting
    clicking on Code on the
    > left
    > up corner in Dreamweaver. If you wrote this page, you
    will find HTML table
    > tags.
    > If you did not, look for this:
    > <table width="901" height="601" border="0"
    cellpadding="0" cellspacing="0"
    > id="Tableau_01"> in your code.
    > Inside this tage add Align="center", so it should look
    like this:
    > <table width="901" height="601" border="0"
    cellpadding="0" cellspacing="0"
    > id="Tableau_01" align="center">
    >
    > I hope my answer is helpful!
    >

  • How to place a JSlider in the middle of an image?

    Hi,
    Here is the deal. I have an image inside a JLabel. That JLabel is inside a JPanel, which in turn is encompassed by a JScrollPane. This image represents some curve or a frequency function, lets say for instance a sine curve. What I need to do is have a slider, positioned (just to keep things simple for now) in the middle of that image, not above or below or to the side of an image, but rather directly over it. Thus, blocking a small section of the image from view. So that the user can drag the mouse cursor along the (horizontal) slider and see the different values on that curve. I dont know of any LayoutManager that would allow me to place a JSlider at an arbitrary position on top of a JLabel, besides just using a Null Layout. However, when I use a Null Layout my scroll bars disappear and the JSlider itself just sits there doing nothing, without reacting to any mouse movements, and mroe importantly as soon as the application is resized, the JSlider disappears completely.
    Any comments/code snippets would be greatly appreciated.
    Thanks,
    Val

    /* From: Java Tutorial - How To Use Layered Panes
    *       LayeredPaneDemo.java
    *       http://java.sun.com/docs/books/tutorial/uiswing/
    *                                components/layeredpane.html
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    public class valy extends JPanel implements ChangeListener {
      private SineWave sineWave = new SineWave();
      JSlider slider;
      JLayeredPane layeredPane;
      public valy() {
        slider = new JSlider(1, 30, 5);
        slider.setBounds(50,125,300,25);
        slider.addChangeListener(this);
        layeredPane = new JLayeredPane();
        layeredPane.setPreferredSize(new Dimension(400,300));
        layeredPane.setBorder(
          BorderFactory.createTitledBorder("Layered Pane App"));
        layeredPane.add(slider, JLayeredPane.PALETTE_LAYER);
        JPanel panel = new JPanel();
        panel.add(sineWave);
        JScrollPane scrollPane = new JScrollPane(panel);
        int width = layeredPane.getPreferredSize().width;
        int height = layeredPane.getPreferredSize().height;
        scrollPane.setBounds(15, 25, width - 30, height - 40);
        layeredPane.add(scrollPane, JLayeredPane.DEFAULT_LAYER);
        add(layeredPane);
      public void stateChanged(ChangeEvent e) {
        sineWave.setCycles(
          ((JSlider)e.getSource()).getValue());
      public static void main(String[] args) {
        JFrame frame = new JFrame();
        JComponent contentPane = new valy();
        contentPane.setOpaque(true);
        frame.setContentPane(contentPane);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocation(300,200);
        frame.setVisible(true);
    /* From: Thinking in Java by Bruce Eckel
      *       3rd edition, Chapter 16
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class SineWave extends JLabel {
      private static int SCALEFACTOR = 200;
      private int cycles, points;
      private double[] sines;
      private int[] pts;
      public SineWave() {
        setCycles(5);
        setPreferredSize(new Dimension(400,400));
      public void setCycles(int newCycles) {
        cycles = newCycles;
        points = SCALEFACTOR * cycles * 2;
        sines = new double[points];
        for(int j = 0; j < points; j++) {
          double radians = (Math.PI/SCALEFACTOR) * j;
          sines[j] = Math.sin(radians);
        repaint();
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D)g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                            RenderingHints.VALUE_ANTIALIAS_ON);   
        int maxWidth = getWidth();
        double hstep = (double)maxWidth/(double)points;
        int maxHeight = getHeight();
        pts = new int[points];
        for(int j = 0; j < points; j++)
          pts[j] =
            (int)(sines[j] * maxHeight/2 * .95 + maxHeight/2);
        g2.setPaint(Color.red);
        for(int j = 1; j < points; j++) {
          int x1 = (int)((j - 1) * hstep);
          int x2 = (int)(j * hstep);
          int y1 = pts[j - 1];
          int y2 = pts[j];
          g2.drawLine(x1, y1, x2, y2);
    }

  • How to invoke a webservice in the middle of a BPM process

    I use BPM studio to create processes.
    In the middle part of the BPM process, it need to invoke a web service (an ADF project deployed to weblogic as a web service). Then, it will wait.
    After the process is finished, it will invoke another web service (an ADF project deployed to weblogic as a web service).
    How to invoke web services in and after the process?
    Thank you.

    Hi,
    Thanks for your reply. I use BPM studio 10.3
    In the Catalogue, there are 3 default components which are Fuego, Java, and Plumtree.
    In the Fuego, there is an item of WebServices. In the Plumtree, there is an item named WebServiceProperty.
    If I create a new Module, I cannot find the option of web service.
    How to invoke a webservice (ADF/Java web service developed in Jdeveloper deploy to weblogic ) ?
    Thanks.

  • How to insert a page in the middle of the document

    How can I add a page in the middle of a document? There are a lot of images in the document and they tend to shift each time I add text.

    Pages version? Number, please!

  • How to center a component on the page????

    Hi all
    i want to center a component on the page
    Sorry it may be some thing trivial ???
    but i ve a command button i want to center it on the page ????
    how???

    Hi,
    try this steps:
    1-surround the command button with panelGroupLayout with layout Horizontal.
    2-In panelGroupLayout property select Style tab.
    3-in the Text tab set horizontal Align with Center.
    4-in Box tab set width with 100 Percent
    if panelGroupLayout inside any other component make this palce width 100 percent and its Align Horizontal with Center.
    Sameh Nassar

  • How to run an Applet using the JDK1.3.1 platform?

    I'm a beginner of Java Applet.
    I've type in the sample program provided in the text book, and compiled it using the jdk1.3.1 platform.
    Usually we run a java program using java [filename], right?
    How about running an applet file?
    What is appletviewer function?
    Thanks!

    I try to put it in a HTML page but it required me to download a Java Virtual Machine.
    I've been searching sources for that but stil cannot get.
    This is always what I get:
    [We're sorry, you cannot view this page because it requires the Microsoft Java Virtual Machine (MSJVM). Your machine does not have the MSJVM installed. For more information please visit www.microsoft.com/java.]
    I visit java.sun.com. On the right side of the page listed with the HOT DOWNLOADS.
    I click on the Java VM but still cannot get anything...
    Can u help me on that?
    I've been trying for 2 days already.
    Thanks!

  • How Do I Fade Out In The Middle Of A Song?

    I cant find out how to do it on certain parts in the middle of a song I am mixing. Can anyone help?

    You may want to head over to http://labs.adobe.com/ and download the public beta release of Soundbooth CS4. It offers multitrack, volume keyframing, and more tools that are better suited for mixing music than the tools offered in Soundbooth CS3.
    Durin

  • How to place af:table in the middle of radio buttons

    Hi,
    I am on jdev 11.1.2.4.
    I've a requirement to have a form with two radio buttons. RB1 & RB2 and af:table component in the middle of these radio buttons
    something like this.
    RB1
    <af:table>
    RB2   <InputTextItem>
    I've tried placing  the table component in the desired place but it's not allowing it.
    please can you help?
    thanks

    Just setup a small sample
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1">
          <af:form id="f1">
            <af:panelStretchLayout topHeight="50px" id="psl1">
              <f:facet name="top">
                <af:outputText value="SelectBooleanRadio Test" id="ot1" inlineStyle="font-size:x-large;"/>
              </f:facet>
              <f:facet name="center">
                <af:panelGroupLayout id="pgl1" layout="vertical">
                  <af:selectBooleanRadio text="Group A" id="sbr1" simple="true" group="myGroup" value="#{bindings.selGroup1.inputValue}" autoSubmit="true"/>
                  <af:panelGroupLayout id="pgl2" layout="vertical">
                    <af:inputText label="Label 1" id="it1" disabled="#{!bindings.selGroup1.inputValue}" partialTriggers="sbr1 sbr2"/>
                    <af:outputText value="selGroup = #{bindings.selGroup1.inputValue}" id="ot2" partialTriggers="sbr1 sbr2"/>
                  </af:panelGroupLayout>
                  <af:selectBooleanRadio text="Group B" label="Label 1" id="sbr2" simple="true" group="myGroup" value="#{bindings.selGroup1.inputValue}"
                                         autoSubmit="true"/>
                </af:panelGroupLayout>
                <!-- id="af_one_column_header_stretched"  -->
              </f:facet>
            </af:panelStretchLayout>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>
    and hte pagedef which holds the variable
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="11.1.1.64.93" id="SelectBooleanPageDef" Package="de.hahn.blog.vctest11g.view.pageDefs">
      <parameters/>
      <executables>
        <variableIterator id="variables">
          <variable Name="selGroup" Type="java.lang.Boolean"/>
        </variableIterator>
      </executables>
      <bindings>
        <attributeValues IterBinding="variables" id="selGroup1">
          <AttrNames>
            <Item Value="selGroup"/>
          </AttrNames>
        </attributeValues>
      </bindings>
    </pageDefinition>
    Timo

  • How to insert 2D applet inside the 3D applet

    i'm doing a project that requires the use of simple 2D applets inside the
    virtual world of Java3D...
    i'm a newbie in Java3D, i've searched the Java3D API specification, and i found nothing..
    can anyone help me .. or even give me an idea on how to do it??
    thanks

    take a look at the
    javax.media.j3d.Billboard
    class
    regards

  • How to stop itunes quitting in the middle of playback

    Hi everyone. Does anyone know how to set my iTunes or Mac up so that iTunes won't quit in the middle of playback? I'm streaming to my TV using Apple TV, and after a while, my screen goes blank and when I go back to my computer to check, I find that iTunes has logged out or quit. I've already set my energy saving preferences to 'never sleep' but this still happens and there is no iTunes preference to prevent it from happening. Any help would be most helpful. Thank you!

    Pages version? Number, please!

  • How to print a picture in the middle of the paper.

    我想把图片打印到纸的中间即上下左右均居中。但是每次打印都是在左上角。

    Can you work out what the actual HTML is to do
    "Whatever it was that you wanted to do" ? { I couldn't understand that }
    I.e If you make up a Test table, with Your Text editor can you get a sample output that looks like you want?
    But the problem is i am able to change the background of the full cell. But i don't need to change the background of the full cell always. For example if Nextti value is 15/1/2005 & Duration is 30 then the shade should start from the middle of January Cell (because of the date 15th)end in the middle of next cell (February). If the duration is 15 then it should end in the (January) same end of cell.
    Is this something that can be done in HTML?
    If your question is 'amenable' to HTML, figure out conditions for which you want to Set a certain color....
    If the color in one cell for instance depends on the Next Cell, then you're going to have to buffer the whole Table ROW....
    Set which ones should be RED for instance, then output that ROW in HTML...
    If you are using Java for this, then also be aware that you might need to escape certain characters like use "\\" to get "\"
    You'd also probaly have an easier time, however you are doing this if you used some sort of CSS .......

Maybe you are looking for

  • Pages (and Keynote and Numbers) won't open after restore from Time Machine.

    Hi, I tried to open my iWork suite tonight and kept getting an error message 'Pages cannot be opened because of a problem' followed by the text, below. Has anyone got any idea what I have done? What I need to do to get them back working? Recently I d

  • AED for domestic purchase

    Hi, Is it possible to take 100 % credit of AED in the same year in case of a domestic purchase of a capital item.If possible what settings needs to be done. Now system is only allowing to take 50% in the current year and the remaining 50% is posted t

  • Help with windows Prcesses  - using "com.jniwrapper.win32.process.Process"

    Hi everybody, I'm trying to get a list of running processes, and for each process I need its Process ID, Process Name, and the command line that run this process. I found a way to get everything but the command-line, by JNI wrappers (below are links

  • How to get chapter selections to work correctly

    I made a movie and set 8 chapters using iMovie 06. I have 8 chapters (4 long x 2 tall) and when I test them with iDVD 09 preview, all of the buttons work perfectly. I can navigate left and right and up and down. I then burned an image file and then t

  • Doubt in reporting

    I have a reporting requirement in which I have to calculate the number of days. The requirement is something like this: A person receives his promotion on 01/20/2006 so when user pulls the report he wants to see how long that person has been in that