Java applet help

iam trying to put the checkboxes in different line
so all the checkbox is alligned
what the syntax to do that??
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.text.DecimalFormat;
public class Computers extends Applet implements ActionListener
     //declare varibles
     double totalCost;
     //contruct Label and Checkboxes
     Label companyName = new Label ("REASONABLE COMPUTER CORPORATION");
     Label system = new Label ("Basic Computer System cost: $575");
     Label choice = new Label ("Select the peripheral devices you want add");
     CheckboxGroup selectGroup = new CheckboxGroup();
          Checkbox printers = new Checkbox("Printer $150",false,selectGroup);
          Checkbox monitors = new Checkbox("Monitor $300",false,selectGroup);
          Checkbox modems = new Checkbox("Modems $100",false,selectGroup);
          Checkbox speaker = new Checkbox("Speaker $20",false,selectGroup);
          Checkbox microphone = new Checkbox("MircoPhone $15",false,selectGroup);
          Checkbox external = new Checkbox ("250G external hard driver $200",false,selectGroup);
     Button calc = new Button("Calculate");
     Label output = new Label("Click Calculate to see your final price");
     //init method for adding the stuff
     public void init()
          setBackground(Color.green);
          setForeground(Color.black);
          add(companyName);
          add(system);
          add(choice);
          add(printers);
          add(monitors);
          add(modems);
          add(speaker);
          add(microphone);
          add(external);
          add(calc);
          calc.addActionListener(this);
          add(output);
     public void actionPerformed(ActionEvent e)
          totalCost = 575 + getCode();
          output(totalCost);
     public double getCode()
          double dollars = 0;
          if (printers.getState()) dollars += 150;
          else if (monitors.getState()) dollars += 300;
          else if (modems.getState()) dollars += 100;
          else if (speaker.getState()) dollars += 20;
          else if (microphone.getState()) dollars += 15;
          else if (external.getState()) dollars += 200;
            return dollars;
     public void output(double totalCost)
          output.setText("Your Final cost is: " + totalCost + ".");
}

hiddendragon wrote:
iam trying to put the checkboxes in different line
so all the checkbox is alligned
what the syntax to do that??There's no "syntax" involved. Instead you have to read up on and study the various layout managers. You could for instance use a BoxLayout to stack information on top of each other, and put your checkboxes in their own panel that uses flowlayout. There's many many ways to arrange this, and the best is the one that works for you. Start here .

Similar Messages

  • Java applet help for mountain lion update on macbook pro

    Hey, I upgraded to the new mountain lion update yesterday and since then when opening java applets, it won't allow me to do anything with them such as entering usernames and passwords. It was working fine yesterday before I did the update but now I can't seem to get it to work. I've reinstalled Java and it says it's all installed correctly. I was wondering if anyone else is having/had the same problem and knows what to do?
    Thanks in advance

    Hi Leonie! I was running into the same problem on my Macbook Air with ML but I just found a soultion that worked for me.
    I downloaded and installed Java 7 from oracle's website.  And then in the java prefences referenced before, changed the Java 7 build to be my default. 
    All my applets work great now for me.
    Hope this helps!

  • Simple java applet help

    im following the java tutorial at their web site online. I'm having problems with these simple applets:
    http://java.sun.com/docs/books/tuto...kMeApplets.html
    I compiled them fine on my other computer, but when I compiled them on the computer I am using presently, I get a problem.
    the files seem to compile fine. but when i compare them with the files online, my files that i compiled are a little less in size. when i load the applet in the provided html file, all i get is a blank gray screen. and when i move the mouse over the gray screen, it says for a split second: "load: class ClickMe not found"
    i have all the correct files...but after compiling the .java files, it doesn't work. the .class files on the web work fine. but my compiled files seem to be smaller than those on the web.
    the ClickMe.class file i compiled is 1.45 KB (1,494 bytes)
    the Spot.class file i compiled is 293 bytes (293 bytes)
    the ClickMe.class file online is 1.50 KB (1,539 bytes)
    the Spot.class file online is 339 bytes (339 bytes)

    I believe that one (or more) of these applats are currently broken - the files are mislocated, I believe. Just skip the clickme applets (unless you want to debug them yourself).

  • Simple java applet help needed

    hi, im having trouble with an applet im developing for a project.
    i have developed an applet with asks the user for simple information( name,address and phone) through textfields, i wish for the applet to store this information in an array when an add button below the textfeilds is pressed.
    client array[];
    array=new client[];//needs to be an infinate array!
    I have created the client class with all the set and get methods plus constructors needed but i dont know how to take the text typed into the textfields by the user and store them in the array.
    i also need to save this info to a file and be able to load it back into the applet.
    Could some please help! Thank you for your time.

    Better maybe redefine the idea using an data structure :
    public class client{
    private char name[];
    private char address[];
    private int phone;
    public class vector_clients{
    private client vect[];
    // methods for vect[]
    What is your opinion about ???

  • Beginner needs Java applet Help!!!

    I would be greatful if someone could answer any of the questions below following the description, thank you:
    Description:
    There are 3 textFields, 3buttons(add,delete,display), and 1 textArea on my applet.
    User types their "name" in the first textField(called tField1)
    User types their "surnname" in the second textField(called tField2)
    User Types their "Town" in the Third textField(called tField3)
    User presses add button to add details to an array of type "member".
    User presses display to view all members(elements of the array) in the TextArea.
    User adds details to textFields and presses the delete button to delete that member.
    member.class:
    Has constructors, individual set and get methods and private attributes name,surname + address plus a toString method.
    Code Behind the ADD button i.e. in the VOID ADD_ACTIONTIONPERFORMED(ACTION EVENT) method:
    Q1.How do i create an array of type member?
    Is it: MEMBER X[] = NEW MEMBER[100]; If so Where does this statement go?
    Q2.How do i allow the user to keep adding more members every time the add button is pressed?
    Code Behind the DISPLAY button i.e. in the VOID DISPLAY_ACTIONTIONPERFORMED(ACTION EVENT) method:
    Q3. How do i get member array elements displayed into the Textfield?
    Code Behind the DELETE button i.e. in the VOID DELETE_ACTIONTIONPERFORMED(ACTION EVENT) method:
    Q4. Deleting user selected elements?
    thanks for your time

    Q1.How do i create an array of type member?
    Is it: MEMBER X[] = NEW MEMBER[100]; Not unless MEMBER is final, which would be inappropriate here + I'd advise the word 'new' though not 'NEW'.
    If so Where does this statement go?In your source code file
    Q2.How do i allow the user to keep adding more members
    every time the add button is pressed?By having source code that creates the conditions for this
    >
    Code Behind the DISPLAY button i.e. in the VOID
    DISPLAY_ACTIONTIONPERFORMED(ACTION EVENT) method:Again these are not final methods, they are overrided methods
    Q3. How do i get member array elements displayed into
    the Textfield?This goes back to the thorny issue of writing code again. It's generally quite hard to do this sort of thing without it.
    >
    Code Behind the DELETE button i.e. in the VOID
    DELETE_ACTIONTIONPERFORMED(ACTION EVENT) method:Again, this is overriden, so final declarations are not permitted
    Q4. Deleting user selected elements?See above, re: source code.
    thanks for your time Welcome, we're here to help

  • URGETN HELP NEEDED! JAVA APPLET READING FILE

    Hi everyone
    I need to hand in this assignment today
    Im trying to read from a file and read it onto the screen, my code keeps showing up an error
    'missing method body, or declare abstract'
    This is coming up for the
    public statuc void main(String[] args);
    and the
    public void init();
    Here is my code:
    import java.io.*;
    import java.awt.*;
    import java.applet.*;
    public class Empty_3 extends Applet {
    TextArea ta = new TextArea();
    public static void main(String[] args);
    public void init();
    setLayout(new BorderLayout());
    add(ta, BorderLayout.CENTER);
    try {
    InputStream in =
    getClass().getResourceAsStream("test1.txt");
    InputStreamReader isr =
    new InputStreamReader(in);
    BufferedReader br =
    new BufferedReader(isr);
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    String line;
    while ((line = br.readLine()) != null) {
    pw.println(line);
    ta.setText(sw.toString());
    } catch (IOException io) {
    ta.setText("Ooops");
    Can anyone help me please?
    Is this the best way of doing this? Once i read the file i want to perform a frequency analysis on the words so if there is a better method for this then please let me know!
    Thankyou
    Matt

    Whether it is urgent or not, does not interest us. It might be urgent for you but for nobody else.
    Writing all-capitals is considered shouting and rude.
    // Use code tags for source.

  • Need help with Java applet, might need NetBeans URL

    I posted the below question. It was never answered, only I was told to post to the NetBeans help forum. Yet I don't see any such forum on this site. Can someone tell me where the NetBeans help forum is located (URL).
    Here is my original question:
    I have some Java source code from a book that I want to compile. The name of the file is HashTest.java. In order to compile and run this Java program I created a project in the NetBeans IDE named javaapplication16, and I created a class named HashTest. Once the project was created, I cut and pasted the below source code into my java file that was default created for HashTest.java.
    Now I can compile and build the project with no errors, but when I try and run it, I get a dialog box that says the following below (Ignore the [...])
    [..................Dialog Box......................................]
    Hash Test class wasn't found in JavaApplication16 project
    Select the main class:
    <No main classes found>
    [..................Dialog Box......................................]
    Does anyone know what the problem is here? Why won't the project run?
    // Here is the source code: *****************************************************************************************************
    import java.applet.*;
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.event.*;
    import java.util.*;
    public class HashTest extends Applet implements ItemListener
    // public static void main(String[] args) {
    // Hashtable to add tile images
    private Hashtable imageTable;
    // a Choice of the various tile images
    private Choice selections;
    // assume tiles will have the same width and height; this represents
    // both a tile's width and height
    private int imageSize;
    // filename description of our images
    private final String[] filenames = { "cement.gif", "dirt.gif", "grass.gif",
    "pebbles.gif", "stone.gif", "water.gif" };
    // initializes the Applet
    public void init()
    int n = filenames.length;
    // create a new Hashtable with n members
    imageTable = new Hashtable(n);
    // create the Choice
    selections = new Choice();
    // create a Panel to add our choice at the bottom of the window
    Panel p = new Panel();
    p.add(selections, BorderLayout.SOUTH);
    p.setBackground(Color.RED);
    // add the Choice to the applet and register the ItemListener
    setLayout(new BorderLayout());
    add(p, BorderLayout.SOUTH);
    selections.addItemListener(this);
    // allocate memory for the images and load 'em in
    for(int i = 0; i < n; i++)
    Image img = getImage(getCodeBase(), filenames);
    while(img.getWidth(this) < 0);
    // add the image to the Hashtable and the Choice
    imageTable.put(filenames[i], img);
    selections.add(filenames[i]);
    // set the imageSize field
    if(i == 0)
    imageSize = img.getWidth(this);
    } // init
    // tiles the currently selected tile image within the Applet
    public void paint(Graphics g)
    // cast the sent Graphics context to get a usable Graphics2D object
    Graphics2D g2d = (Graphics2D)g;
    // save the Applet's width and height
    int width = getSize().width;
    int height = getSize().height;
    // create an AffineTransform to place tile images
    AffineTransform at = new AffineTransform();
    // get the currently selected tile image
    Image currImage = (Image)imageTable.get(selections.getSelectedItem());
    // tile the image throughout the Applet
    int y = 0;
    while(y < height)
    int x = 0;
    while(x < width)
    at.setToTranslation(x, y);
    // draw the image
    g2d.drawImage(currImage, at, this);
    x += imageSize;
    y += imageSize;
    } // paint
    // called when the tile image Choice is changed
    public void itemStateChanged(ItemEvent e)
    // our drop box has changed-- redraw the scene
    repaint();
    } // HashTest

    BigDaddyLoveHandles wrote:
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    That wasn't attention-grabbing enough apparantly. Let's try it again.
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}

  • �� I have a java applet program (yanhua.java) need help!!!

    �� I have a java applet program (yanhua.java) that use mouse click a area show a fireworks, the applet program that a java fan mail me. Now i find some bug in the program, can you help me? thank in advance!
    The backdrop of the question: The yanhua.java applet program works well. But one day, i install j2re 1.4.1 plugin for my microsfot Internet Explorer, i run the yanhua.java applet program again, it show difficult(i move my mouse in the area, slowness), the fireworks is not fluent. Then i try my best to find the cause , i get some information, the following: yanhua.java run in j2re 1.4.1 plugin,it will deplete 100% cpu; else yanhua.java does not run in j2re 1.4.1 plugin, it will deplete 90%--95% cpu too; but my computer c3 1G cpu and 256MB memory, without running other program at that time. So i can have the assurance to say that the yanhua.java have some bug or error. can you help me to find all bug in yanhua.java? thank you very much!!!
    i want to solve the question: finding all bug in yanhua.java
    NOTE:
    1��fireworks show specially good effect(a yanhua.java applet) you can look at:
    http://www.3ren.net/down/java/yanhua.html
    2��all program you can get from http://www.3ren.net/down/java/yanhua.rar
    /*************************yanhua.java******************************
    import java.applet.Applet;
    import java.applet.AudioClip;
    import java.awt.*;
    import java.awt.image.MemoryImageSource;
    import java.util.Random;
    public class yanhua extends Applet
    implements Runnable
    private int m_nAppX;
    private int m_nAppY;
    private int m_centerX;
    private int m_centerY;
    private int m_mouseX;
    private int m_mouseY;
    private int m_sleepTime;
    private boolean isError;
    private boolean m_isPaintFinished;
    boolean isRunning;
    boolean isInitialized;
    Thread runner;
    int pix0[];
    MemoryImageSource offImage;
    Image dbImg;
    int pixls;
    int pixls2;
    Random rand;
    int bits;
    double bit_px[];
    double bit_py[];
    double bit_vx[];
    double bit_vy[];
    int bit_sx[];
    int bit_sy[];
    int bit_l[];
    int bit_f[];
    int bit_p[];
    int bit_c[];
    int bit_max;
    int bit_sound;
    int ru;
    int rv;
    AudioClip sound1;
    AudioClip sound2;
    public yanhua()
    m_mouseX = 0;
    m_mouseY = 0;
    m_sleepTime = 5;
    isError = false;
    isInitialized = false;
    rand = new Random();
    bits = 10000;
    bit_px = new double[bits];
    bit_py = new double[bits];
    bit_vx = new double[bits];
    bit_vy = new double[bits];
    bit_sx = new int[bits];
    bit_sy = new int[bits];
    bit_l = new int[bits];
    bit_f = new int[bits];
    bit_p = new int[bits];
    bit_c = new int[bits];
    ru = 50;
    rv = 50;
    public void init()
    String s = getParameter("para_bits");
    if(s != null)
    bits = Integer.parseInt(s);
    s = getParameter("para_max");
    if(s != null)
    bit_max = Integer.parseInt(s);
    s = getParameter("para_blendx");
    if(s != null)
    ru = Integer.parseInt(s);
    s = getParameter("para_blendy");
    if(s != null)
    rv = Integer.parseInt(s);
    s = getParameter("para_sound");
    if(s != null)
    bit_sound = Integer.parseInt(s);
    m_nAppX = this.getSize().width;
    m_nAppY = this.getSize().height;
    m_centerX = m_nAppX / 2;
    m_centerY = m_nAppY / 2;
    m_mouseX = m_centerX;
    m_mouseY = m_centerY;
    resize(m_nAppX, m_nAppY);
    pixls = m_nAppX * m_nAppY;
    pixls2 = pixls - m_nAppX * 2;
    pix0 = new int[pixls];
    offImage = new MemoryImageSource(m_nAppX, m_nAppY, pix0, 0, m_nAppX);
    offImage.setAnimated(true);
    dbImg = createImage(offImage);
    for(int i = 0; i < pixls; i++)
    pix0[i] = 0xff000000;
    sound1 = getAudioClip(getDocumentBase(), "firework.au");
    sound2 = getAudioClip(getDocumentBase(), "syu.au");
    for(int j = 0; j < bits; j++)
    bit_f[j] = 0;
    isInitialized = true;
    start();
    public void run()
    while(!isInitialized)
    try
    Thread.sleep(200L);
    catch(InterruptedException interruptedexception) { }
    do
    for(int j = 0; j < pixls2; j++)
    int k = pix0[j];
    int l = pix0[j + 1];
    int i1 = pix0[j + m_nAppX];
    int j1 = pix0[j + m_nAppX + 1];
    int i = (k & 0xff0000) >> 16;
    int k1 = ((((l & 0xff0000) >> 16) - i) * ru >> 8) + i;
    i = (k & 0xff00) >> 8;
    int l1 = ((((l & 0xff00) >> 8) - i) * ru >> 8) + i;
    i = k & 0xff;
    int i2 = (((l & 0xff) - i) * ru >> 8) + i;
    i = (i1 & 0xff0000) >> 16;
    int j2 = ((((j1 & 0xff0000) >> 16) - i) * ru >> 8) + i;
    i = (i1 & 0xff00) >> 8;
    int k2 = ((((j1 & 0xff00) >> 8) - i) * ru >> 8) + i;
    i = i1 & 0xff;
    int l2 = (((j1 & 0xff) - i) * ru >> 8) + i;
    int i3 = ((j2 - k1) * rv >> 8) + k1;
    int j3 = ((k2 - l1) * rv >> 8) + l1;
    int k3 = ((l2 - i2) * rv >> 8) + i2;
    pix0[j] = i3 << 16 | j3 << 8 | k3 | 0xff000000;
    rend();
    offImage.newPixels(0, 0, m_nAppX, m_nAppY);
    try
    Thread.sleep(m_sleepTime);
    catch(InterruptedException interruptedexception1) { }
    } while(true);
    public void update(Graphics g)
    paint(g);
    public void paint(Graphics g)
    g.drawImage(dbImg, 0, 0, this);
    public void start()
    if(isError)
    return;
    isRunning = true;
    if(runner == null)
    runner = new Thread(this);
    runner.start();
    public void stop()
    if(runner != null)
    runner.stop();
    runner = null;
    public boolean mouseMove(Event event, int i, int j)
    m_mouseX = i;
    m_mouseY = j;
    return true;
    public boolean mouseDown(Event event, int i, int j)
    m_mouseX = i;
    m_mouseY = j;
    int k = (int)(rand.nextDouble() * 256D);
    int l = (int)(rand.nextDouble() * 256D);
    int i1 = (int)(rand.nextDouble() * 256D);
    int j1 = k << 16 | l << 8 | i1 | 0xff000000;
    int k1 = 0;
    for(int l1 = 0; l1 < bits; l1++)
    if(bit_f[l1] != 0)
    continue;
    bit_px[l1] = m_mouseX;
    bit_py[l1] = m_mouseY;
    double d = rand.nextDouble() * 6.2800000000000002D;
    double d1 = rand.nextDouble();
    bit_vx[l1] = Math.sin(d) * d1;
    bit_vy[l1] = Math.cos(d) * d1;
    bit_l[l1] = (int)(rand.nextDouble() * 100D) + 100;
    bit_p[l1] = (int)(rand.nextDouble() * 3D);
    bit_c[l1] = j1;
    bit_sx[l1] = m_mouseX;
    bit_sy[l1] = m_nAppY - 5;
    bit_f[l1] = 2;
    if(++k1 == bit_max)
    break;
    if(bit_sound > 1)
    sound2.play();
    return true;
    public boolean mouseExit(Event event, int i, int j)
    m_mouseX = i;
    m_mouseY = j;
    return true;
    void rend()
    boolean flag = false;
    boolean flag1 = false;
    boolean flag2 = false;
    for(int k = 0; k < bits; k++)
    switch(bit_f[k])
    default:
    break;
    case 1: // '\001'
    bit_vy[k] += rand.nextDouble() / 50D;
    bit_px[k] += bit_vx[k];
    bit_py[k] += bit_vy[k];
    bit_l[k]--;
    if(bit_l[k] == 0 || bit_px[k] < 0.0D || bit_py[k] < 0.0D || bit_px[k] > (double)m_nAppX || bit_py[k] > (double)(m_nAppY - 3))
    bit_c[k] = 0xff000000;
    bit_f[k] = 0;
    } else
    if(bit_p[k] == 0)
    if((int)(rand.nextDouble() * 2D) == 0)
    bit_set((int)bit_px[k], (int)bit_py[k], -1);
    } else
    bit_set((int)bit_px[k], (int)bit_py[k], bit_c[k]);
    break;
    case 2: // '\002'
    bit_sy[k] -= 5;
    if((double)bit_sy[k] <= bit_py[k])
    bit_f[k] = 1;
    flag2 = true;
    if((int)(rand.nextDouble() * 20D) == 0)
    int i = (int)(rand.nextDouble() * 2D);
    int j = (int)(rand.nextDouble() * 5D);
    bit_set(bit_sx[k] + i, bit_sy[k] + j, -1);
    break;
    if(flag2 && bit_sound > 0)
    sound1.play();
    void bit_set(int i, int j, int k)
    int l = i + j * m_nAppX;
    pix0[l] = k;
    /*********************************end*******************************

    no one help me???????????

  • Please, help me with file access in Java Applet.

    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    public class ImageVi extends Applet {
         URL PicPath1;
         Image Img1;
         public void init()
              try
                   PicPath1 = new URL("http://nurchi.far.ru/pic/s08.jpg");
              } catch (MalformedURLException Excep1) {}
         public void paint(Graphics g) {
              Img1=getImage(PicPath1);
              g.drawImage(Img1, 10, 10, this);
    The error message is:
    Exception occurred during event dispatching:
    java.security.AccessControlException: access denied (java.net.SocketPermission nurchi.far.ru resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:195)
    at java.security.AccessController.checkPermission(AccessController.java, Compiled Code)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java, Compiled Code)
    at java.lang.SecurityManager.checkConnect(SecurityManager.java:1019)
    at sun.awt.image.URLImageSource.<init>(URLImageSource.java:48)
    at sun.applet.AppletImageRef.reconstitute(AppletImageRef.java:40)
    at sun.misc.Ref.get(Ref.java:53)
    at sun.applet.AppletViewer.getCachedImage(AppletViewer.java:275)
    at sun.applet.AppletViewer.getImage(AppletViewer.java:270)
    at java.applet.Applet.getImage(Applet.java:190)
    at ImageVi.paint(ImageVi.java:24)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:116)
    at java.awt.Component.dispatchEventImpl(Component.java:2452)
    at java.awt.Container.dispatchEventImpl(Container.java:1059)
    at java.awt.Component.dispatchEvent(Component.java:2312)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:301)
    at java.awt.EventDispatchThread.pumpOneEventForComponent(EventDispatchThread.java:120)
    at java.awt.EventDispatchThread.pumpEventsForComponent(EventDispatchThread.java:95)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:90)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

    Applets are not allowed to connect to other server
    than the one they were loaded from. This is probably
    the reason here.You mean that I can use the applet after uploading on my web-site and using "getDocumentBase()" only?
    OK.
    The applet works perfectly if I use that function, but I have another question.
    If I want to use something like:
    Img1=getImage(getDocumentBase(), "s01.jpg");
    it works perfectly.
    If I do the fillowing:
    Img1=getImage(getDocumentBase(), "pic/s01.jpg");
    it also works.
    But is it possible to go a level up?
    Like:
    Img1=getImage(getDocumentBase(), "../pic/s01.jpg");
    That is if an applet is in one folder and the pictures are in another, but to get to them I have to go a level up and then enter another folder.
    Please help.
    Thanks.

  • Newbie need help wtih Java Applet noinit error

    Hi, i am having problem with a making this java applet application run, i am new to java but i am sure that my coding is right, because this what i typed from my java class book. Don't know why when i try to run it is say at the bottom of the windows explorer, "applet class name "noinit"". The code is listed below maybe someone could help me figure this out. I used NetBean to compile it, also I have the latest version of java but could not find a applet that come with the newest version of java so I'm using the j2sdk1.4.2_11 applet, and have added it to my system environment path. Maybe that could be the problem if so where do i get the newest version of the applet, because without doing what i did i could run applets in the first place. My other sample applet sample (demo's) that come with Java runs fine without any problem. Only when i run mine i get the message, "applet class name noinit".
    HTML file:
    <!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=iso-8859-1" />
    <title>Welcome Applet</title>
    </head>
    <!-- Used to load the Java .class file -->
    <applet code="WelcomeApplet.class" width="300" height="45">
    alt="Your browser understands the <;APPLET> tag but isn't running the applet, for some reason."
         Your browser is completely ignoring the <APPLET> tag!
    </applet>
    <body>
    </body>
    </html>Java code:
    /* Fig. 3.6: WelcomeApplet.java
    *  My first applet in Java
    * Created on May 2, 2006, 2:50 AM
    // Java packages
    package appletjavafig3_6;
    import java.awt.Graphics;   // import class Graphics
    import javax.swing.JApplet; // import class JApplet
    public class WelcomeApplet extends JApplet {
        public WelcomeApplet(){
        // 3rd method that is called by default
        // draw text on applets's background
        public void paint( Graphics g)
            // call superclass version of method paint
            super.paint(g);
            // draw a String at x-coordinate 25 and y coordinate 25
            g.drawString("Welcome to Java Programming!", 25,25);
        } // end method paint
    } // WelcomeApplet

    Hi,
    Your applet code in the html should be
    <applet code="appletjavafig3_6.WelcomeApplet" width="300" height="45">
    alt="Your browser understands the <;APPLET> tag but isn't running the applet, for some reason."
         Your browser is completely ignoring the <APPLET> tag!
    </applet>As the class is inside a package named appletjavafig3_6, put the class file inside a folder named appletjavafig3_6. Put the html file outside this folder and test it.

  • Help Needed urgently - MKTCALENDAR button removal from java applet

    Hi Experts ,
    We have a requirement to remove buttons from the markeing calendar/projects applet .
    In Marketing->Search->Marketing Calendar , when we click on search button , result is displayed in the result view . This is a java applet and has a toolbar with buttons like new,save,copy etc,fields with drop down and also the result list below it.
    We have the option to prevent the button functionalities by controlling authorization to SAP objects.But my requirement is to completely hide these buttons from getting displayed in the applet view.
    Can anyone help me regarding how to remove the buttons from the java applet  .
    Appreciate the help a lot.
    Thanks
    Swapna.

    hii,
    checkout my add from, HTH
    [http://forums.sun.com/thread.jspa?threadID=5419921&messageID=10885709#10885709]
    ... kopik

  • Can anyone help with the java applet issue

    Hello everyone,
    This is my first thread in this forum,
    I need a little help with the form developer...
    I have oracle 9i db , 9i form developer
    I don't want to run the form i created as a java applet
    HOW IS THAT DONE i.e NOT IN THE INTERNET EXPLORER?????????
    ***IF ITS POSSIBLE

    Hello,
    I don't want to run the form i created as a java applet
    No chance, because the Web Forms client is an applet and cannot be anything else.
    Francois

  • Help with java applets

    Ok i know i haven't read the applet tutorial or had much experience with applets but just hear me out and see if you can help me.
    BACKGROUND
    Ok...so i have previously viewed an applet on windows viewing an html file on my computer. I am trying to view just the most simple applet (helloworld) on linux. I'm using Ubuntu linux, the latest version as of February 23, 2006.I created an applet file and an html file in the same directory with the html file having an <applet> tag in it linking to the HelloWorldApp. I have tried viewing the html file and the java applet won't load. Everything other than the applet worked and I'm just stuck.
    So my plea is would somebody please just paste the bare minimum html file and applet file that you can see an applet with? I want to learn about applets and will do the tutorial but I would really like to just see one.
    Please help,
    A frustrated applet noob
    p.s.
    According to java.com I have installed JRE 5.0 and i have compiled a java application so I'm pretty sure I have successfully installed JDK 5.0.

    Bob, what web browser are you using?
    Make sure that the browser supports Java applets.
    If you want just to debug your applet try appletviewer utility
    from JDK first.

  • Java Script - Java Applet Communication help me

    hi
    In my website i used html form to get the input from user. the user press the button the value are passed into java applet. The result will display in applet.
    my HTML coding for calling applet is
    <SCRIPT LANGUAGE="JavaScript"><!--
    var info = navigator.userAgent; var ns = false;
    var ie = (info.indexOf("MSIE") > 0 && info.indexOf("Win") > 0 && info.indexOf("Windows 3.1") < 0);
    //--></SCRIPT>
    <SCRIPT LANGUAGE="JavaScript"><!--
    if (_ie == true) document.writeln('<Center><OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="360" height="350" codebase="http://java.sun.com/products/plugin/1.1.2/jinstall-112-win32.cab#Vers ion=1,1,2,0"><NOEMBED><XMP>');
    else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.1.2" java_CODE = "suddhi.class" name=SuddhiPanchang width="360" height="350" pluginspage="http://java.sun.com/products/plugin/1.1.2/plugin-install.html"> <NOEMBED><XMP>');
    //--></SCRIPT>
    <APPLET mayscript="true" CODE = "suddhi.class" width="450" height="200" name=SuddhiPanchang ></XMP>
    <PARAM NAME = CODE VALUE = "suddhi.class" >
    </APPLET></NOEMBED></EMBED></OBJECT>
    java script code
    function calculate()
    if(checkEntries(document.forms[0]))return;
    with(Math){
    var day1 = floor(document.forms[0].Day1.value);
    var mon1 = floor(document.forms[0].Month1.selectedIndex) +1;
    var year1 = floor(document.forms[0].Year1.value);
    var day2 = floor(document.forms[0].Day2.value);
    var mon2 = floor(document.forms[0].Month2.selectedIndex) +1;
    var year2 = floor(document.forms[0].Year2.value);
    var tzone = abs(floor(document.forms[0].ZoneHour.value));
    tzone += floor(document.forms[0].ZoneMin.value)/60;
    if(Math.floor(document.forms[0].ZoneHour.value)<0.0) tzone *= -1;
    document.SuddhiPanchang.setStart(day1,mon1,year1,day2,mon2,year2,tzone);}
    i have error in the above line
    'document.SuddhiPanchang' is null or not an object
    url: http:\\rafik.cheyon.com\panch\msuddhi.htm check this
    please help me
    thanx

    You need to access it as document.formname.objectname

  • Loading Java Applet Failed... HELP ME PLEASE !

    Hello,
    Recently I can not view Java applets.
    This is what I see in the console :
    Java Plug-in 1.5.0_06
    Using JRE version 1.5.0_06 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\?????
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    l:   dump classloader list
    m:   print memory usage
    o:   trigger logging
    p:   reload proxy configuration
    q:   hide console
    r:   reload policy configuration
    s:   dump system and deployment properties
    t:   dump thread list
    v:   dump thread stack
    x:   clear classloader cache
    0-5: set trace level to <n>
    load: class loader.class not found.
    java.lang.ClassNotFoundException: loader.class
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 morePlease, help me, I really need it.

    This line:
    User home directory = C:\Documents and Settings\?????
    is odd - what are the question marks doing there? They should be naming the user's directory. Have you used non-ASCII characters for the directory name?
    If so, you might want to try installing under a different user.

Maybe you are looking for

  • "The page cannot be displayed" error in RWB with IE6 on Windows XP SP2

    The following screens in the RWB give an error "The page cannot be displayed": - End-to-end monitoring - Alert Configuration - Alert Inbox My colleague who is on IE6 on Windows 2000 can display the pages. We have the same roles. I searched on SAP not

  • Importing from  iPhoto '11 to Aperture 3.2 - no keywords imported!

    I've tried importing my IPhoto '11 (9.2) library into Aperture 3.2 now THREE times -- the last time via a clean re-install, yet none of my iPhoto keywords show up with my photos in Aperture.  Otherwise the import went ok.  Any ideas what went wrong a

  • Can I use split function in PLD?

    Dear Experts, Can anyone show me if I have this value in a variable F_001 in PLD. 012345-FAB How can I get the below output?  (Taking off the -FAB, by either using a split() function or equivalent) 012345 Much Thanks! Chinho

  • Services are getting closed.

    Hi all, I do have SUN 420R with Solaris 9 with Oracle database and webbase application running. The services are to be started and stopped by the appliation shelll scripts. And when i tried to start them they are working fine. but they all runnig unt

  • Difficulty Restoring IMAP emails with Time Machine

    I use Gmail IMAP in Apple Mail and I'm finding it difficult to restore my inbox because the IMAP automatically synchronizes with the server after the Time Machine restore. Even when I take my account offline first and then do the TM restore, the emai