How to use drawLine not in Applet

I need your help.
I am new in Java programming.
I use bean to display 3 photos on a web page.
One is very big and the two last are like labels.
I would like to draw a line from these labels to that big photo.
And I did not succeed to use the drawLine method.
Someone can help me please??
Thanks
Gwan

Hi rapy_xjb!
It's troublesome, would need to deploy applet and all dependent classes! A lot of files to download (in jar file or not)! Think in benefits to user after installing Java plug-in. My lemma: Java and diamonds are forever!
Best regards.

Similar Messages

  • How to use jsp:plugin type="applet" in jsp

    Hi ,
    I have a JSP File.
    How to use jsp:plugin tag in that.
    When I specify the file name in code="applet.class" Then it is giving an error saying that It could not find the class.
    What is the solution for this.

    its not working.. it shows exception class not found exception.
    i have placed the jsp and applet class in the same folder. but its not working.
    jsp file path : OracleSpatial\mypackage\webmap.jsp
    applet class : OracleSpatial\mypackage\demoApplet.class
    demoApplet class inside package "mypackage".
    code inside JSP is :
    <jsp:plugin type="applet"
    code="mypackage.demoApplet.class" width = "100%" height = "100%" >
    </jsp:plugin>

  • How to use JNI in an Applet?

    Can a native method can be invoken in an Applet?If it can,which knowledge of Java should be used and how to use it?

    You could I suppose if yo sign the applet (which, if the user accepts it, will allow it to use features otherwise not available to an applet because of the secure sandbox). However, I am not sure how you would deploy the necessary native library since it must be available to the native OS loader (ie, a file on the client machine). If you are deploying the applets (see WebStart perhaps) you could do it.
    But generally it is a poor idea to try to use JNI in an Applet, and this is probably something that you would not want to use outside of an intranet environment.
    Chuck

  • How to use the not exists query

    Hello,
    Using obiee 11g,
    i would like to know how to deal with not exists query in the obiee11g,
    the query is like this
    select count(a.col1),a.col2 from table1 a ,table2 b where a.col1=b.col1
    and not exists
    (select d.col1 from table3 d, table4 e
    where d.col1=e.col1 and d.col1=a.col1)
    group by a.col2
    there are 4 tables.
    table1,table2,table3,tabel4
    this is what i need in a report,these tables are used in othere places also,
    would prefer if its possible to do in for a report i.e.e analysis itself.
    If not possible then may be in rpd since if i change in rpd it may reflect every place
    and not in for a report itself.
    thanks

    Implement this in report itself can be a tricky and tedious job..But better to have it in RPD - Physical - Select Table type
    USE NOT IN in place of NOT Exist..You can simply use SELECT statement in SELECT TABLE TYPE
    Hope it clear

  • How to use DOMParser from an Applet / Or, how to parse XML from an Applet?

    Hey,
    As stating in the subject line, I wonder how to do it without getting an �Access Denied� error.
    I would like to parse a XML file that has external DTD pointing to a SYSTEM location. Yes, I can change it to a public location. However, in either way, I have problems to use DOMBuilder to parse the xml file. The application always throws the security exception.
    I tried to use the DOMParser from org.apache.xerces.parsers to parse the xml file. I set the DOMParser to ignore parsing the external DTD, and use the DOMParser.parse(InputSource) to parse the xml file from a giving URL. However, I get null of the result document.
    Does anyone know how to parse the XML from an Applet? Or, does anyone know how to use the DOMParser from an Applet?
    Thank you very much,

    If the document resides on the local filesystem, you will need to sign a CAB or JAR for the applet to circumvent the sandbox's security restrictions. There are dozens of posts on how to do this. Basically, that will turn the applet into an application, from a Java security perspective.
    - Saish
    "My karma ran over your dogma." - Anon

  • How To use JVM (not CreateJavaVM)??

    Using JNI, I want to call the java class from C..
    Generally, I use "JNI_CreateJavaVM" method to create JavaVM's instance.
    when it continually call C execution file,
    it use much memory owing to creation of much JavaVM's Instances.
    1. I want to know how to use before create instance
    without creats another instance using "JNI_CreateJavaVM"
    2. I want to know how to use JavaVM that only create one it's instance.
    Any examples would be appreciated.
    Thank you very much.

    Hi,
    try to create one C thread for every Java application that you have to start. See http://java.sun.com/docs/books/tutorial/native1.1/invoking/invo.html file attach.c
    I.E. (hp-ux):
    pthread_create()...
    jvm->AttachCurrentThread((void **)&env,NULL);
    jobjectArray joa = env->NewObjectArray(argc, env->FindClass("java/lang/String"), NULL); // Parameters....
    jclass cls=env->FindClass("your class");
    jmethodID mid=env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
    [env->RegisterNatives(cls,pmethParGui,1);] JNI CALL
    env->CallStaticVoidMethod(cls, mid, joa);
    jvm->DetachCurrentThread();
    pthread_exit...
    If your Java application use static memory, your memory will be shared.

  • How to use power not battery?

    Just got new Mac Book Pro--my first laptop.  I am confused about the power cord and the power adapter.  How do I run the laptop using power connection instead of battery?  The power cord only plugs into the adapter, not the machine.  I'm off to a great start--can't seem to figure this out.

    Yes, in fact it's a good idea to use the AC adaptor whenever it's convenient. There's no harm done to the computer or to the battery. See more:
    About Batteries in Modern Apple Laptops
    Apple - Batteries - Notebooks
    Extending the Life of Your Laptop Battery
    Apple - Batteries
    Determining Battery Cycle Count
    Calibrating your computer's battery for best performance
    MacBook and MacBook Pro- Mac reduces processor speed when battery is removed while operating from an A-C adaptor
    Battery University
    Thanks for clarifying your question as I was certainly in the wrong ball park.

  • Help !! How to use SmtpClient in an Applet?

    Hi,
    I have 2 TextFields and a button in an Applet. On click of the button, I wanted to get connected to an email server (e.g pop.mail.yahoo.com) and post my message using (smtp.mail.yahoo.com) to "[email protected]" . I tried this programme using both URL and Sockets. But in both cases I am getting "NullPointerException". Can any one help me with this problem by giving some source code?
    Here is my code:
    if (ae.getSource().equals(button1))
    System.out.println("Clicked Send");
    try
    sendmail = new SmtpClient("smtp.mail.yahoo.com");
    //sendmail = new SmtpClient("java.sun.com");
    System.out.println("connecting......");
    System.out.println("SendMail:" +sendmail);
    sendmail.from(getString);
    sendmail.to("mailto:[email protected]");
    //sendmail.to("[email protected]");
    ps = sendmail.startMessage();
    System.out.println("PS :" +ps);
    //succeed = true;
    catch(Exception e)
    //e.printStackTrace();
    System.out.println("Couldn't reach you through javasoft, trying your local machine instead. You probably are behind a firewall.");
    The source code has been provided, can any one help me?
    Thanks
    [email protected]

    well the answer is simple
    "sendmail" object is NULL and ur trying to access the methods from it.
    When u instantiate SmtpClient. It just creates a Object. it does not actually connect to the MailServer. u would probably need to luk into API and find out the appropriate method for connect......well i haven't myself luked into the API so i am not too sure about this
    Manja

  • How to use different (not local) user for NTLM auth in Authenticator?

    Hi All,
    I use custom authenticator to provide user / passwords to connect to .NET Web Services. I overloaded function getPasswordAuthentication() that returns right user / password combination for the requested URL. It all works perfectly for many kinds of HTTP connections: basic, ntlm, ntlm-v2, through proxy, ssl, etc.
    My problem is that during NTLM authentication from Windows computers JVM uses credentials of the currently logged in domain user instead of calling Authenticator to get other user / password provided by the user. In case when local user credentials fail to authenticate, JVM calls my Authenticator but in case authentication is successful it does uses local domain user and never calls my Authenticator. The issue is when this local domain user does not have enough permissions but authenticated correctly there is no way to supply JVM with another user to begin with.
    What can I do to force JVM to ignore local domain user and to use Authenticator to collect credentials during NTLM authentication requested by the server in case the software runs on a Windows box with currently logged in domain user?
    I am looking for the answer for a long time already but found only questions and suggestions to switch server from NTLM authentication which is not an option for me. From the developer's view it has to be pretty simple change for Sun to do in Java networking API. Is there any way to escalate it to Sun support? Maybe there is some property in some JRE patch level that allows to do this?
    Thank you very much!
    Mark

    Thank you for the reply. I have kind of an opposite problem. I can perfectly connect from Linux computers to Microsoft IIS servers using NTLM or even NTLMv2 authentication. My problem is connecting from Windows client computer joined to the same domain as IIS server with the domain user logged in to this computer. In this case this user account will be used in any HTTP connections I initiate to this IIS server instead of the one that I want to supply in my custom Authenticator.
    I have graphical interactive application that connects to IIS Server. When user runs it and connects to IIS server I want to prompt for the user/password regardless whether JRE may correctly authenticate using current user account credentials. The current user may not have enough permissions in IIS application so I want to use different user to login to IIS application.
    Thank you anyway,
    Mark

  • How to use setTint() ?

    Hi, if you know how to use the setTint() funciton please,
    drop me and example code!
    What I am trying to do is tint 60% black some
    thumbnails(Sprites), it does have to be 60% perse, I can use a
    Black Shape on a Sprite on top of the thumbnails and set the color
    of the shape to 60% alpha to the black color but I saw setTint I
    want to use it, or how can I do the same thing using
    colorTransform, wich I know how to use, but not sure how to tweak
    the values to get it right.
    Thanks for your time!
    rS

    Well, no one
    OK so i did use colorTransform
    To do Something like Tint Black @ 50%
    ColorTransform(0.5, 0.5, 0.5, 1, 0, 0, 0, 0);
    To take it back to normal colors
    ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
    If you know a better way please share it
    rS

  • Need a Big Help please on how to use getAppletContext() method

    I have three classes, first one extends JApplet, second class I use two create my popup menus, third class I use for my main actions to be done. I need when a popup menu is clicked to load a page, but I am getting this error.
    java.lang.NullPointerException
    at java.applet.Applet.getAppletContext(Applet.java:171)
    at Popup_Menus$1.actionPerformed(Popup_Menus.java:90)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
    at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
    at java.awt.Component.processMouseEvent(Component.java:5134)
    at java.awt.Component.processEvent(Component.java:4931)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3639)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3480)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Component.dispatchEvent(Component.java:3480)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Ev
    My Code is messy, but here it is: -
    Class One
    //package final_project;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.util.*;
    import java.io.*;
    import java.applet.*;
    import java.net.*;
    public class Main_Interface extends JApplet implements Runnable {
    GUICanvas MainCanvas;
    int counter = 0;
    protected int delay = 10000;
    private Thread timeThread= null;
         public void init() {
         Container contentPane = getContentPane();
    MainCanvas = new GUICanvas();
    contentPane.setBounds(0,0,850,650);
         contentPane.add(MainCanvas);
    public void start() {
    timeThread = new Thread(this);
    timeThread.start();
    public void run() {
    Thread myThread = Thread.currentThread();
    while (timeThread == myThread) {
    try {
    Thread.currentThread().sleep(delay);
    } catch (InterruptedException e){}
    counter ++;
    MainCanvas.TheKing();
    Class Two
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.util.*;
    import java.io.*;
    import java.applet.*;
    import java.net.*;
    import java.applet.*;
    public class Popup_Menus extends Applet implements MouseListener {
    JPopupMenu ar[] = new JPopupMenu[16];
    JMenuItem it[] = new JMenuItem[84];
    public Popup_Menus() {
    for (int i=0;i<16;i++)
    ar[i] = new JPopupMenu();
    for (int i=0;i<84;i++)
    it[i] = new JMenuItem();
    it.setBackground(Color.orange);
    it[i].setForeground(Color.cyan);
    it[16]= new JMenuItem("Shop Details");
    it[17]= new JMenuItem("NoOfStaff");
    it[18]= new JMenuItem("ShopAssest");
    it[0] = new JMenuItem("Oracle");
    ar[0].add(it[0]);
    it[1] = new JMenuItem("Macrosoft");
    ar[1].add(it[1]);
    it[2] = new JMenuItem("SunMicro");
    ar[2].add(it[2]);
    it[3] = new JMenuItem("PeopleSoft");
    ar[3].add(it[3]);
    it[4] = new JMenuItem("HP");
    ar[4].add(it[4]);
    it[5] = new JMenuItem("Dell");
    ar[5].add(it[5]);
    it[6] = new JMenuItem("Compact");
    ar[6].add(it[6]);
    it[7] = new JMenuItem("Apple");
    ar[7].add(it[7]);
    it[8] = new JMenuItem("Sony");
    ar[8].add(it[8]);
    it[9] = new JMenuItem("Philipes");
    ar[9].add(it[9]);
    it[10] = new JMenuItem("Bush");
    ar[10].add(it[0]);
    it[11] = new JMenuItem("Granada");
    ar[11].add(it[11]);
    it[12] = new JMenuItem("PC");
    ar[12].add(it[12]);
    it[13] = new JMenuItem("Macintosh");
    ar[13].add(it[13]);
    it[14] = new JMenuItem("Laptop");
    ar[14].add(it[14]);
    it[15] = new JMenuItem("Solaris");
    ar[15].add(it[15]);
    it[0].addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
    ar[0].add(it[16]);
    ar[0].add(it[17]);
    ar[0].add(it[18]);
    System.out.println("Working");
    // ma = new Main_Interface();
    try
    System.out.println("menuitem");
    String s="ali";
    URL url = new URL("http://www.google.com");
    getAppletContext().showDocument(url,s);
    catch(MalformedURLException malformedurlexception)
    System.err.println(malformedurlexception);
    public void mouseClicked(java.awt.event.MouseEvent e) {
    //ar[0].show(this,30,30);
    public void mouseEntered(java.awt.event.MouseEvent mouseEvent) {
    public void mouseExited(java.awt.event.MouseEvent mouseEvent) {
    public void mousePressed(java.awt.event.MouseEvent mouseEvent) {
    public void mouseReleased(java.awt.event.MouseEvent mouseEvent) {
    Class Three
    //package final_project;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.util.*;
    import java.io.*;
    import java.applet.*;
    import java.net.*;
    public class GUICanvas extends JPanel implements MouseMotionListener,ActionListener,MouseListener
    private Color color;
    Popup_Menus popup = new Popup_Menus();
    private Font font;
    double a1, Q = 0,Z = 0,P = 1, S1;
    String Percentages;
    double Aa=0,Ba=0,Ca=0,Da=0;
    double Aa1=0,Ba1=0,Ca1=0,Da1=0;
    double Aa2=0,Ba2=0,Ca2=0,Da2=0;
    double Aa3=0,Ba3=0,Ca3=0,Da3=0;
    double Aa4=0,Ba4=0,Ca4=0,Da4=0;
    double Sum = 0,Sum1 = 0, Sum2 = 0, Sum3 = 0, Sum4 = 0;
    double A=0, B=0, C=0, D=0;
    double A1=0, B1=0, C1=0, D1=0,A2=0, B2=0, C2=0, D2=0;
    double k1=0,k2=0,l1=0,l2=0,r1=0,r2=0,u1=0,u2=0;
    int xpos,ypos,popcounter=0;
    double DC1[] = new double[4];
    double DC2[] = new double[4];
    double DC3[] = new double[4];
    double DC4[] = new double[4];
    boolean rect1Active[] = new boolean[4];
    boolean rect1Active2[] = new boolean[4];
    boolean rect1Active3[] = new boolean[4];
    boolean rect1Active4[] = new boolean[4];
    double DF1[] = new double[4];
    double DF2[] = new double[4];
    double DF3[] = new double[4];
    double DF4[] = new double[4];
    double Ap[] = new double[4];
    double Bp[] = new double[4];
    double Cp[] = new double[4];
    double Dp[] = new double[4];
    int rect1width[] = new int[4];
    int rect1height[] = new int[4];
    int rect1xco[] = new int[4];
    int rect1yco[] = new int[4];
    int rect1width2[] = new int[4];
    int rect1height2[] = new int[4];
    int rect1xco2[] = new int[4];
    int rect1yco2[] = new int[4];
    int rect1width3[] = new int[4];
    int rect1height3[] = new int[4];
    int rect1xco3[] = new int[4];
    int rect1yco3[] = new int[4];
    int rect1width4[] = new int[4];
    int rect1height4[] = new int[4];
    int rect1xco4[] = new int[4];
    int rect1yco4[] = new int[4];
    double rect1width5[] = new double[4];
    double rect1height5[] = new double[4];
    double rect1xco5[] = new double[4];
    double rect1yco5[] = new double[4];
    public GUICanvas() {
    setBackground( Color.black );
    TheKing();
    addMouseListener(this);
    addMouseMotionListener(this);
    public void TheKing()
    double X=740, Y=470, Ap=0,Bp=0,Cp=0,Dp=0;
    String line[] = new String[4];
    /* try {
    URL url = new URL(
         "http://localhost:111/test/servlet/TestServlet");
    BufferedReader in = new BufferedReader(
         new InputStreamReader(url.openStream()));
    for (int i = 0; i<4; i++)
    line[i] = in.readLine();
    in.close();
    }catch (Exception e){
    e.printStackTrace();
    line[0] = "200";
    line[1] = "200";
    line[2] = "200";
    line[3] = "200";
    Aa = s2d(line[0]);
    Ba = s2d(line[1]);
    Ca = s2d(line[2]);
    Da = s2d(line[3]);
    rect1xco5[0] = 20;
    rect1yco5[0] = 20;
    Sum=Aa+Ba+Ca+Da;
    Ap = (Aa/Sum)*100;
    Bp = (Ba/Sum)*100;
    Cp = (Ca/Sum)*100;
    Dp = (Da/Sum)*100;
    A= (Ap/100)*(X*Y);
    B= (Bp/100)*(X*Y);
    C= (Cp/100)*(X*Y);
    D= (Dp/100)*(X*Y);
    Q = ((A*C)+(X*Y*D)+(X*C*Y)+(B*X*Y)-(Y*A*X)-((X*X)*(Y*Y))-(B*D))/((X*(Y*Y))-(Y*D)-(C*Y));
    Z = (((X*X)*Y*A)-(X*C*A)-(B*X*A))/((X*(Y*Y))-(Y*D)-(C*Y));
    A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
    A2=A/A1;
    B1=X-A1;
    B2=B/B1;
    D2=Y-A2;
    D1=D/D2;
    C1=X-D1;
    C2=C/C1;
    S1=B2+C2;
    rect1width5[0] = d2i(A1);
    rect1height5[0] = d2i(A2);
    rect1width5[1] = d2i(B1);
    rect1height5[1] = d2i(B2);
    rect1width5[2] = d2i(D1);
    rect1height5[2] = d2i(D2);
    rect1width5[3] = d2i(C1);
    rect1height5[3] = d2i(C2);
    rect1xco5[1] = rect1xco5[0] + rect1width5[0];
    rect1yco5[1] = rect1xco5[0];
    rect1xco5[2] = rect1xco5[0];
    rect1yco5[2] = rect1yco5[0] + rect1height5[0];
    rect1xco5[3] = rect1xco5[0] + rect1width5[2];
    rect1yco5[3] = rect1yco5[0] + rect1height5[1];
    k1=rect1xco5[0]+rect1width5[0];
    k2=rect1yco5[0]+rect1height5[0];
    l1=rect1width5[1]-20;
    l2=rect1yco5[1]+rect1height5[1];
    r1=rect1xco5[0]+rect1width5[2];
    r2=rect1height5[2]-20;
    u1=rect1width5[3]-20;
    u2=rect1height5[3]-20;
    RegionOne(k1, k2);
    RegionTwo(l1,l2);
    RegionThree(r1, r2);
    RegionFour(u1, u2);
    public void RegionOne(double X1, double Y1)
    String line[] = new String[4];
    /* try {
    URL url = new URL(
         "http://localhost:111/test/servlet/TestServlet1?name=ONE");
    BufferedReader in = new BufferedReader(
         new InputStreamReader(url.openStream()));
    for (int i = 0; i<4; i++)
    line[i] = in.readLine();
    in.close();
    }catch (Exception e){
    e.printStackTrace();
    line[0] = "1200";
    line[1] = "2100";
    line[2] = "1200";
    line[3] = "2100";
    DC1[0] = Aa1 ;
    DC1[1] = Ba1 ;
    DC1[2] = Ca1;
    DC1[3] = Da1;
    Aa1 = s2d(line[0]);
    Ba1 = s2d(line[1]);
    Ca1 = s2d(line[2]);
    Da1 = s2d(line[3]);
    DF1[0] = Aa1 ;
    DF1[1] = Ba1 ;
    DF1[2] = Ca1;
    DF1[3] = Da1;
    rect1xco[0] = 20;
    rect1yco[0] = 20;
    Sum1=Aa1+Ba1+Ca1+Da1;
    Ap[0] = (Aa1/Sum1)*100;
    Bp[0] = (Ba1/Sum1)*100;
    Cp[0] = (Ca1/Sum1)*100;
    Dp[0] = (Da1/Sum1)*100;
    A= (Ap[0]/100)*(X1*Y1);
    B= (Bp[0]/100)*(X1*Y1);
    C= (Cp[0]/100)*(X1*Y1);
    D= (Dp[0]/100)*(X1*Y1);
    Q = ((A*C)+(X1*Y1*D)+(X1*C*Y1)+(B*X1*Y1)-(Y1*A*X1)-((X1*X1)*(Y1*Y1))-(B*D))/((X1*(Y1*Y1))-(Y1*D)-(C*Y1));
    Z = (((X1*X1)*Y1*A)-(X1*C*A)-(B*X1*A))/((X1*(Y1*Y1))-(Y1*D)-(C*Y1));
    A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
    A2=A/A1;
    B1=X1-A1;
    B2=B/B1;
    D2=Y1-A2;
    D1=D/D2;
    C1=X1-D1;
    C2=C/C1;
    S1=B2+C2;
    rect1width[0] = d2i(A1);
    rect1height[0] = d2i(A2);
    rect1width[1] = d2i(B1);
    rect1height[1] = d2i(B2);
    rect1width[2] = d2i(D1);
    rect1height[2] = d2i(D2);
    rect1width[3] = d2i(C1);
    rect1height[3] = d2i(C2);
    rect1xco[1] = rect1xco[0] + rect1width[0];
    rect1yco[1] = rect1xco[0];
    rect1xco[2] = rect1xco[0];
    rect1yco[2] = rect1yco[0] + rect1height[0];
    rect1xco[3] = rect1xco[0] + rect1width[2];
    rect1yco[3] = rect1yco[0] + rect1height[1];
    public void RegionTwo(double X2, double Y2)
    String line[] = new String[4];
    /* try {
    URL url = new URL(
         "http://localhost:111/test/servlet/TestServlet1?name=TWO");
    BufferedReader in = new BufferedReader(
         new InputStreamReader(url.openStream()));
    for (int i = 0; i<4; i++)
    line[i] = in.readLine();
    in.close();
    catch (Exception e){
    e.printStackTrace();
    line[0] = "1200";
    line[1] = "2100";
    line[2] = "1200";
    line[3] = "2100";
    DC2[0] = Aa2;
    DC2[1] = Ba2;
    DC2[2] = Ca2;
    DC2[3] = Da2;
    Aa2 = s2d(line[0]);
    Ba2 = s2d(line[1]);
    Ca2 = s2d(line[2]);
    Da2 = s2d(line[3]);
    DF2[0] = Aa2 ;
    DF2[1] = Ba2 ;
    DF2[2] = Ca2;
    DF2[3] = Da2;
    rect1xco2[0] = rect1xco[1]+rect1width[1];
    rect1yco2[0] = 20;
    Sum2=Aa2+Ba2+Ca2+Da2;
    Ap[1] = (Aa2/Sum2)*100;
    Bp[1] = (Ba2/Sum2)*100;
    Cp[1] = (Ca2/Sum2)*100;
    Dp[1] = (Da2/Sum2)*100;
    A= (Ap[1]/100)*(X2*Y2);
    B= (Bp[1]/100)*(X2*Y2);
    C= (Cp[1]/100)*(X2*Y2);
    D= (Dp[1]/100)*(X2*Y2);
    Q = ((A*C)+(X2*Y2*D)+(X2*C*Y2)+(B*X2*Y2)-(Y2*A*X2)-((X2*X2)*(Y2*Y2))-(B*D))/((X2*(Y2*Y2))-(Y2*D)-(C*Y2));
    Z = (((X2*X2)*Y2*A)-(X2*C*A)-(B*X2*A))/((X2*(Y2*Y2))-(Y2*D)-(C*Y2));
    A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
    A2=A/A1;
    B1=X2-A1;
    B2=B/B1;
    D2=Y2-A2;
    D1=D/D2;
    C1=X2-D1;
    C2=C/C1;
    rect1width2[0] = d2i(A1);
    rect1height2[0] = d2i(A2);
    rect1width2[1] = d2i(B1);
    rect1height2[1] = d2i(B2);
    rect1width2[2] = d2i(D1);
    rect1height2[2] = d2i(D2);
    rect1width2[3] = d2i(C1);
    rect1height2[3] = d2i(C2);
    rect1xco2[1] = rect1xco2[0] + rect1width2[0];
    rect1yco2[1] = rect1yco2[0];
    rect1xco2[2] = rect1xco2[0];
    rect1yco2[2] = rect1yco2[0] + rect1height2[0];
    rect1xco2[3] = rect1xco2[0] + rect1width2[2];
    rect1yco2[3] = rect1yco2[0] + rect1height2[1];
    public void RegionThree(double X3, double Y3)
    String line[] = new String[4];
    /* try {
    URL url = new URL(
         "http://localhost:111/test/servlet/TestServlet1?name=THREE");
    BufferedReader in = new BufferedReader(
         new InputStreamReader(url.openStream()));
    for (int i = 0; i<4; i++)
    line[i] = in.readLine();
    in.close();
    catch (Exception e){
    e.printStackTrace();
    line[0] = "1200";
    line[1] = "2100";
    line[2] = "1200";
    line[3] = "2100";
    DC3[0] = Aa3 ;
    DC3[1] = Ba3 ;
    DC3[2] = Ca3;
    DC3[3] = Da3;
    Aa3 = s2d(line[0]);
    Ba3 = s2d(line[1]);
    Ca3 = s2d(line[2]);
    Da3 = s2d(line[3]);
    DF3[0] = Aa3 ;
    DF3[1] = Ba3;
    DF3[2] = Ca3;
    DF3[3] = Da3;
    rect1xco3[0] = 20;
    rect1yco3[0] = rect1yco[2]+rect1height[2];
    Sum3=Aa3+Ba3+Ca3+Da3;
    Ap[2] = (Aa3/Sum3)*100;
    Bp[2] = (Ba3/Sum3)*100;
    Cp[2] = (Ca3/Sum3)*100;
    Dp[2] = (Da3/Sum3)*100;
    A= (Ap[2]/100)*(X3*Y3);
    B= (Bp[2]/100)*(X3*Y3);
    C= (Cp[2]/100)*(X3*Y3);
    D= (Dp[2]/100)*(X3*Y3);
    Q = ((A*C)+(X3*Y3*D)+(X3*C*Y3)+(B*X3*Y3)-(Y3*A*X3)-((X3*X3)*(Y3*Y3))-(B*D))/((X3*(Y3*Y3))-(Y3*D)-(C*Y3));
    Z = (((X3*X3)*Y3*A)-(X3*C*A)-(B*X3*A))/((X3*(Y3*Y3))-(Y3*D)-(C*Y3));
    A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
    A2=A/A1;
    B1=X3-A1;
    B2=B/B1;
    D2=Y3-A2;
    D1=D/D2;
    C1=X3-D1;
    C2=C/C1;
    rect1width3[0] = d2i(A1);
    rect1height3[0] = d2i(A2);
    rect1width3[1] = d2i(B1);
    rect1height3[1] = d2i(B2);
    rect1width3[2] = d2i(D1);
    rect1height3[2] = d2i(D2);
    rect1width3[3] = d2i(C1);
    rect1height3[3] = d2i(C2);
    rect1xco3[1] = rect1xco3[0] + rect1width3[0];
    rect1yco3[1] = rect1yco[3] + rect1height[3];
    rect1xco3[2] = rect1xco3[0];
    rect1yco3[2] = rect1yco3[0] + rect1height3[0];
    rect1xco3[3] = rect1xco3[0] + rect1width3[2];
    rect1yco3[3] = rect1yco3[0] + rect1height3[1];
    public void RegionFour(double X4, double Y4)
    String line[] = new String[4];
    /*try {
    URL url = new URL(
         "http://localhost:111/test/servlet/TestServlet1?name=FOUR");
    BufferedReader in = new BufferedReader(
         new InputStreamReader(url.openStream()));
    for (int i = 0; i<4; i++)
    line[i] = in.readLine();
    in.close();
    catch (Exception e){
    e.printStackTrace();
    line[0] = "1200";
    line[1] = "2100";
    line[2] = "1200";
    line[3] = "2100";
    DC4[0] = Aa4 ;
    DC4[1] = Ba4 ;
    DC4[2] = Ca4;
    DC4[3] = Da4;
    Aa4 = s2d(line[0]);
    Ba4 = s2d(line[1]);
    Ca4 = s2d(line[2]);
    Da4 = s2d(line[3]);
    DF4[0] = Aa4 ;
    DF4[1] = Ba4 ;
    DF4[2] = Ca4;
    DF4[3] = Da4;
    rect1xco4[0] = rect1xco3[1]+rect1width3[1];
    rect1yco4[0] = rect1yco2[2]+rect1height2[2];
    Sum4=Aa4+Ba4+Ca4+Da4;
    Ap[3] = (Aa4/Sum4)*100;
    Bp[3] = (Ba4/Sum4)*100;
    Cp[3] = (Ca4/Sum4)*100;
    Dp[3] = (Da4/Sum4)*100;
    A= (Ap[3]/100)*(X4*Y4);
    B= (Bp[3]/100)*(X4*Y4);
    C= (Cp[3]/100)*(X4*Y4);
    D= (Dp[3]/100)*(X4*Y4);
    Q = ((A*C)+(X4*Y4*D)+(X4*C*Y4)+(B*X4*Y4)-(Y4*A*X4)-((X4*X4)*(Y4*Y4))-(B*D))/((X4*(Y4*Y4))-(Y4*D)-(C*Y4));
    Z = (((X4*X4)*Y4*A)-(X4*C*A)-(B*X4*A))/((X4*(Y4*Y4))-(Y4*D)-(C*Y4));
    A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
    A2=A/A1;
    B1=X4-A1;
    B2=B/B1;
    D2=Y4-A2;
    D1=D/D2;
    C1=X4-D1;
    C2=C/C1;
    rect1width4[0] = d2i(A1);
    rect1height4[0] = d2i(A2);
    rect1width4[1] = d2i(B1);
    rect1height4[1] = d2i(B2);
    rect1width4[2] = d2i(D1);
    rect1height4[2] = d2i(D2);
    rect1width4[3] = d2i(C1);
    rect1height4[3] = d2i(C2);
    rect1xco4[1] = rect1xco4[0] + rect1width4[0];
    rect1yco4[1] = rect1yco2[2]+rect1height2[2];
    rect1xco4[2] = rect1xco4[0];
    rect1yco4[2] = rect1yco4[0] + rect1height4[0];
    rect1xco4[3] = rect1xco4[0] + rect1width4[2];
    rect1yco4[3] = rect1yco4[0] + rect1height4[1];
    static int d2i(double d) {return (int) Math.round(d);}
    static double i2d(int i) {return (double) i;}
    static double s2d(String s)
    double i=0;
    try{  return i = Double.parseDouble(s);}
    catch(NumberFormatException e)
    {  e.printStackTrace();}
    return i;
    public void paintComponent(Graphics g) {
    super.paintComponent(g);
    int k11=d2i(k1);
    int k21=d2i(k2);
    int l11=d2i(l1);
    int l21=d2i(l2);
    int r11=d2i(r1);
    int r21=d2i(r2);
    int u11=d2i(u1);
    int u21=d2i(u2);
    g.setColor(Color.magenta);
    g.drawRect(rect1xco[0]-2,rect1yco[0]-2,k11+2,k21+2);
    g.drawRect(rect1xco[0]-1,rect1yco[0]-1,k11+2,k21+1);
    g.drawRect(rect1xco2[0]+1,rect1yco2[0]-1,l11+1,l21+1);
    g.drawRect(rect1xco2[0]+1,rect1yco2[0]-2,l11+2,l21+2);
    g.drawRect(rect1xco3[0]-1,rect1yco3[0]+1,r11+2,r21+1);
    g.drawRect(rect1xco3[0]-2,rect1yco3[0]+1,r11+2,r21+2);
    g.drawRect(rect1xco4[0]+1,rect1yco4[0]+1,u11+2,u21+1);
    g.drawRect(rect1xco4[0]+1,rect1yco4[0]+1,u11+1,u21+2);
    g.setColor(Color.cyan);
    g.drawRect(16,16,749,479);
    g.drawRect(17,17,747,477);
    if (rect1Active[0])
    // First Rectangle's coloring of the Region One
    if(DC1[0] == DF1[0])
    g.setColor(Color.black);
    g.fillRect(rect1xco[0]+2,rect1yco[0]+2,rect1width[0]-4,rect1height[0]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[0],rect1yco[0],rect1width[0]-1,rect1height[0]-1);
    g.drawRect(rect1xco[0]+1,rect1yco[0]+1,rect1width[0]-3,rect1height[0]-3);
    else if(DC1[0] > DF1[0])
    g.setColor(Color.red);
    g.fillRect(rect1xco[0]+2,rect1yco[0]+2,rect1width[0]-4,rect1height[0]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[0],rect1yco[0],rect1width[0]-1,rect1height[0]-1);
    g.drawRect(rect1xco[0]+1,rect1yco[0]+1,rect1width[0]-3,rect1height[0]-3);
    else if(DC1[0] < DF1[0])
    g.setColor(Color.green);
    g.fillRect(rect1xco[0]+2,rect1yco[0]+2,rect1width[0]-4,rect1height[0]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[0],rect1yco[0],rect1width[0]-1,rect1height[0]-1);
    g.drawRect(rect1xco[0]+1,rect1yco[0]+1,rect1width[0]-3,rect1height[0]-3);
    else
    if(DC1[0] == DF1[0])
    g.setColor(Color.black);
    g.fillRect(rect1xco[0],rect1yco[0],rect1width[0],rect1height[0]);
    else if(DC1[0] > DF1[0])
    g.setColor(Color.red);
    g.fillRect(rect1xco[0],rect1yco[0],rect1width[0],rect1height[0]);
    else if(DC1[0] < DF1[0])
    g.setColor(Color.green);
    g.fillRect(rect1xco[0],rect1yco[0],rect1width[0],rect1height[0]);
    if (rect1Active[1])
    // Second Rectangle's coloring of the Region One
    if(DC1[1] == DF1[1])
    g.setColor(Color.black);
    g.fillRect(rect1xco[1]+2,rect1yco[1]+2,rect1width[1]-4,rect1height[1]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[1],rect1yco[1],rect1width[1]-1,rect1height[1]-1);
    g.drawRect(rect1xco[1]+1,rect1yco[1]+1,rect1width[1]-3,rect1height[1]-3);
    else if(DC1[1] > DF1[1])
    g.setColor(Color.red);
    g.fillRect(rect1xco[1]+2,rect1yco[1]+2,rect1width[1]-4,rect1height[1]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[1],rect1yco[1],rect1width[1]-1,rect1height[1]-1);
    g.drawRect(rect1xco[1]+1,rect1yco[1]+1,rect1width[1]-3,rect1height[1]-3);
    else if(DC1[1] < DF1[1])
    g.setColor(Color.green);
    g.fillRect(rect1xco[1]+2,rect1yco[1]+2,rect1width[1]-4,rect1height[1]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[1],rect1yco[1],rect1width[1]-1,rect1height[1]-1);
    g.drawRect(rect1xco[1]+1,rect1yco[1]+1,rect1width[1]-3,rect1height[1]-3);
    else
    if(DC1[1] == DF1[1])
    g.setColor(Color.black);
    g.fillRect(rect1xco[1],rect1yco[1],rect1width[1],rect1height[1]);
    else if(DC1[1] > DF1[1])
    g.setColor(Color.red);
    g.fillRect(rect1xco[1],rect1yco[1],rect1width[1],rect1height[1]);
    else if(DC1[1] < DF1[1])
    g.setColor(Color.green);
    g.fillRect(rect1xco[1],rect1yco[1],rect1width[1],rect1height[1]);
    if (rect1Active [2])
    // Third Rectangle's coloring of the Region One
    if(DC1[2] == DF1[2])
    g.setColor(Color.black);
    g.fillRect(rect1xco[2]+2,rect1yco[2]+2,rect1width[2]-4,rect1height[2]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[2],rect1yco[2],rect1width[2]-1,rect1height[2]-1);
    g.drawRect(rect1xco[2]+1,rect1yco[2]+1,rect1width[2]-3,rect1height[2]-3);
    else if(DC1[2] > DF1[2])
    g.setColor(Color.red);
    g.fillRect(rect1xco[2]+2,rect1yco[2]+2,rect1width[2]-4,rect1height[2]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[2],rect1yco[2],rect1width[2]-1,rect1height[2]-1);
    g.drawRect(rect1xco[2]+1,rect1yco[2]+1,rect1width[2]-3,rect1height[2]-3);
    else if(DC1[2] < DF1[2])
    g.setColor(Color.green);
    g.fillRect(rect1xco[2]+2,rect1yco[2]+2,rect1width[2]-4,rect1height[2]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[2],rect1yco[2],rect1width[2]-1,rect1height[2]-1);
    g.drawRect(rect1xco[2]+1,rect1yco[2]+1,rect1width[2]-3,rect1height[2]-3);
    else
    if(DC1[2] == DF1[2])
    g.setColor(Color.black);
    g.fillRect(rect1xco[2],rect1yco[2],rect1width[2],rect1height[2]);
    else if(DC1[2] > DF1[2])
    g.setColor(Color.red);
    g.fillRect(rect1xco[2],rect1yco[2],rect1width[2],rect1height[2]);
    else if(DC1[2] < DF1[2])
    g.setColor(Color.green);
    g.fillRect(rect1xco[2],rect1yco[2],rect1width[2],rect1height[2]);
    if (rect1Active [3])
    //Fourth Rectangle's coloring of the Region One
    if(DC1[3] == DF1[3])
    g.setColor(Color.black);
    g.fillRect(rect1xco[3]+2,rect1yco[3]+2,rect1width[3]-4,rect1height[3]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[3],rect1yco[3],rect1width[3]-1,rect1height[3]-1);
    g.drawRect(rect1xco[3]+1,rect1yco[3]+1,rect1width[3]-3,rect1height[3]-3);
    else if(DC1[3] > DF1[3])
    g.setColor(Color.red);
    g.fillRect(rect1xco[3]+2,rect1yco[3]+2,rect1width[3]-4,rect1height[3]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[3],rect1yco[3],rect1width[3]-1,rect1height[3]-1);
    g.drawRect(rect1xco[3]+1,rect1yco[3]+1,rect1width[3]-3,rect1height[3]-3);
    else if(DC1[3] < DF1[3])
    g.setColor(Color.green);
    g.fillRect(rect1xco[3]+2,rect1yco[3]+2,rect1width[3]-4,rect1height[3]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[3],rect1yco[3],rect1width[3]-1,rect1height[3]-1);
    g.drawRect(rect1xco[3]+1,rect1yco[3]+1,rect1width[3]-3,rect1height[3]-3);
    else
    if(DC1[3] == DF1[3])
    g.setColor(Color.black);
    g.fillRect(rect1xco[3],rect1yco[3],rect1width[3],rect1height[3]);
    else if(DC1[3] > DF1[3])
    g.setColor(Color.red);
    g.fillRect(rect1xco[3],rect1yco[3],rect1width[3],rect1height[3]);
    else if(DC1[3] < DF1[3])
    g.setColor(Color.green);
    g.fillRect(rect1xco[3],rect1yco[3],rect1width[3],rect1height[3]);
    if (rect1Active2[0])
    // First Rectangle's coloring of the Region Two
    if(DC2[0] == DF2[0])
    g.setColor(Color.black);
    g.fillRect(rect1xco2[0]+4,rect1yco2[0]+2,rect1width2[0]-4,rect1height2[0]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0]-1,rect1height2[0]-1);
    g.drawRect(rect1xco2[0]+3,rect1yco2[0]+1,rect1width2[0]-3,rect1height2[0]-3);
    else if(DC2[0] > DF2[0])
    g.setColor(Color.red);
    g.fillRect(rect1xco2[0]+4,rect1yco2[0]+2,rect1width2[0]-4,rect1height2[0]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0]-1,rect1height2[0]-1);
    g.drawRect(rect1xco2[0]+3,rect1yco2[0]+1,rect1width2[0]-3,rect1height2[0]-3);
    else if(DC2[0] < DF2[0])
    g.setColor(Color.green);
    g.fillRect(rect1xco2[0]+4,rect1yco2[0]+2,rect1width2[0]-4,rect1height2[0]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0]-1,rect1height2[0]-1);
    g.drawRect(rect1xco2[0]+3,rect1yco2[0]+1,rect1width2[0]-3,rect1height2[0]-3);
    else
    if(DC2[0] == DF2[0])
    g.setColor(Color.black);
    g.fillRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0],rect1height2[0]);
    else if(DC2[0] > DF2[0])
    g.setColor(Color.red);
    g.fillRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0],rect1height2[0]);
    else if(DC2[0] < DF2[0])
    g.setColor(Color.green);
    g.fillRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0],rect1height2[0]);
    if (rect1Active2[1])
    // Second Rectangle's coloring of the Region Two
    if(DC2[1] == DF2[1])
    g.setColor(Color.black);
    g.fillRect(rect1xco2[1]+4,rect1yco2[1]+2,rect1width2[1]-4,rect1height2[1]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco2[1]+2,rect1yco2[1],rect1width2[1]-1,rect1height2[1]-1);
    g.drawRect(rect1xco2[1]+3,rect1yco2[1]+1,rect1width2[1]-3,rect1height2[1]-3);

    Could you show me how to use it as an applet. If you
    can modify my code and make it working it would be
    very helpful.
    Best regards
    AliPerhaps you could start [url http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html]here[url                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Is there instructions on how to use Xcode

    hi messing around with developing  is there instructions on how to use xcode not sure how 'hello world' useing c coding is working also theres a lot of options? read the java tip but really i dont know were to start

    no need to answer this i have seen were it is

  • How can i use this as an applet ?

    i have this applet :
    import java.applet.*;
    import java.io.*;
    public class calculator2 extends Applet {
    /*<Applet code=calculator2.class width=500 height=500></applet>*/
    /*the above comment has to be there for applet view to work. Type in at the promt "appletviewer calculator2.java"*/
    public void init() {
    int num1,num2,num3,num4,num5,num6,sum;
    num1 = num2 = num3 = num4 = num5 = num6 = sum = 0;
    /*Program statemants start here*/
    BufferedReader br = null;
    try {
    br = new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Input Rent");
    num1 = Integer.parseInt(br.readLine());
    System.out.println("Input Utility bills");
    num2 = Integer.parseInt(br.readLine());
    System.out.println("Input mobile bills");
    num3 = Integer.parseInt(br.readLine());
    System.out.println("Input food");
    num4 = Integer.parseInt(br.readLine());
    System.out.println("Input soialising");
    num5 = Integer.parseInt(br.readLine());
    System.out.println("Input savings");
    num6 = Integer.parseInt(br.readLine());
    sum=num1+num2+num3+num4+num5+num6;
    System.out.println("Enter your income: ");
    int income = Integer.parseInt(br.readLine());
    income -= sum;System.out.println(income);
    } catch (IOException ioe) {
    } catch (NumberFormatException nfe) {
    System.out.println("That wasn't a valid number!");
    System.out.println("Someone else did my homework for me! ");
    but when i run it i still need to write my answers in the comand prompt window not the applet its self,
    i know i need to do something like this but i don't know how
    add the line import java.awt; Instead of using System.out.println you can
    a)Paint the characters using paint
    public void paint(Graphics g){
    g.drawString(x, y, "" + yourVariableName); //use this for each System.out.println
    b)store the variables in a label and add
    Label yourName = newLabel("")// do this for each thing you want to print.
    yourName.setText("" + yourVariableName); //replace all sytem.out.println with this.
    anyone offer any advice ??
    thanking you in advance
    Anthony

    You seem to be asking an awful lot of questions that could be found in any basic Java textbook. Won't make you too popular on here!
    This should get you started anyway
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class calculator2 extends Applet implements ActionListener
    int total;
    Label label1, label2;
    TextField text1, text2;
    Button clicker;
    public void init()
    label1 = new Label ("Input Rent");
    label2 = new Label ("Input Bills");
    text1 = new TextField (5);
    text2 = new TextField (5);
    clicker = new Button("Calculate");
    add(label1);
    add(text1);
    add(label2);
    add(text2);
    add(clicker);
    clicker.addActionListener(this);
    } // end init
    public void paint (Graphics g)
    g.drawString ("The total is " + total, 50,100);
    } // end paint
    public void actionPerformed (ActionEvent e)
    total = Integer.parseInt(text1.getText()) +Integer.parseInt(text2.getText());
    repaint();
    } // end actionPerformed
    } // end class

  • How to use the applet to upload the file ?

    I am facing a problem that , I don't know how to use applet to upload the file to server .
    I have the code to upload the file by using servlet .
    However , I want to use applet to upload the file .But , the format of servlet I have used is "multipart/form-data"
    but applet can not do so , I think it is the header of the data . I don't know what can I do .....
    Can anyone give me some suggestion or coding to write the file upload by using applet ?
    Besides , using the socket are there any other choices ?
    thx a lot !!!!

    Well, to upload files you need to
    Server App - running on the webserver
    1. Open a socket
    (Study the classes Socket, InputStream, OutputStream in the Java API)
    2. Wait for connection.
    3. Open FileOutputStream
    3. Read data from InputStream, Write to FileOutputStream
    4. Close InputStream and FileOutputStream
    Applet
    1. Open a filedialog (Swing, AWT)
    2. Open file (FileInputStream)
    3. Connect to uploadServer (steps described above)
    4. Read FileInputStream, write OutputStream
    5. Close File and Socket
    This is just simpl and basic terms get you on the right track
    Jonas

  • How to use C-Structure in java applets

    hi alls,
    I want to use a struct model (struct in C++) in java applets. i know class is used in java applications. but, how can i convert in java applets?
    class renk
    int r;
    int gr;
    int b;
    import java.awt.Graphics;
    import java.awt.Color;
    import java.awt.Event;
    import java.applet.Applet;
    public class benek extends Applet
    final int n=10;
    int x[] = new int[n];
    int y[] = new int[n];
    int count = 0;
    renk clr[] = new renk[n];
    public void init()
    setBackground(Color.black);
    public boolean mouseDown(Event yordam, int xyer, int yyer)
    if (count<n)
    System.out.println("...");
    ekle(xyer,yyer);
    else System.out.println("Kapasite Doldu...");
    return true;
    void ekle(int xyer, int yyer)
    int r1 = (int)Math.floor(Math.random()*256);
    int gr1 = (int)Math.floor(Math.random()*256);
    int b1 = (int)Math.floor(Math.random()*256);
    clr[count].r = r1;
    clr[count].gr = gr1;
    clr[count].b = b1;
    x[count]=xyer;
    y[count]=yyer;
    count++;
    repaint();
    public void paint(Graphics g)
    it gives error message... how can � use struct model in java applets???
    if you help me i will be greatfull....

    � use import but it doesn't work.
    i add: import renk; or import class renk;
    how will � add import I assumed based on your initial post that the renk and benek classes were in the same file. Apparently you're saying they are not. So for another thing, make your renk class "public class renk", and add the "public" keyword to the 3 members of that class. Then if your code still doesn't see the "renk" class, it would just be that you don't have the directory that contains the compiled "renk.class" in your classpath.

Maybe you are looking for

  • Invalid method "Save As" from Excel application object

    I have Windows 2000 and Excel 2002 installed on my machine. I down loaded "renamed Excel 2000 workbook.vi" from NI website. Relinked ref num to Excel application object but get the error of invalid method (Save As). Tried to relink invoke node to Sav

  • OWB Workflow Queue Listener

    Hi , We are trying to schedule the OWB 3i mappings using OEM 2.2 and Workflow 2.6.2.We have a queue listener 'workflowqlsnr.bat' on the client side,but we need to have the Workflow Queue Listenter on the Server side.Please let me know what is the pro

  • Having objects move in to and out of a frame (screen shots explaining)

    Hi I've got a wireframe I'm now trying to add interaction to in catalyst. I've got a drop down menu the user will work from and I want it so that when they click a button the screen in the menu slides away and a new screen slides in. Please see the v

  • 6500 Slide new firmware 9.60

    It seems there's new software out today, version 9.60 for the 6500 slide. I'm currently on v8.30. Has anyone updated and can tell me of any new features, bugs, etc? My last post on this got deleted for some reason - mods, do not delete without tellin

  • ALSA sound stutters/freezes

    I had ALSA set up and working without any problems before today. This morning I rearranged my hard drive partitioning scheme and now it seems ALSA is messed up. Could there be a connection? I noticed it when mpd was acting funny (a song would be show