DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Randy Guest

    Help with passing variables


    I have been working with the following code with no sucess.
    The needed result is to print the variable to the applet. In the future
    I also want to send a query string to an asp page containing the variable.

    public class test17 extends Applet{
    public String theName;
    public void main(String args[]) {
    theName ="testing";
    }
    public void paint (Graphics g) {
    g.setFont(new Font("Helvetica",Font.PLAIN,12));
    g.drawString("Name:"+theName, 10, 250);
    }

    Thank you for any help with this.

    Randy

  2. #2
    UP Guest

    Re: Help with passing variables


    DO you really want to use main method with applet? and again if you want to
    convert that applet to an application syntex of main method is public static
    void main(String[] args)

    "Randy" <randy@psi-games.com> wrote:
    >
    >I have been working with the following code with no sucess.
    >The needed result is to print the variable to the applet. In the future


    >I also want to send a query string to an asp page containing the variable.
    >
    >public class test17 extends Applet{
    >public String theName;
    >public void main(String args[]) {
    > theName ="testing";
    > }
    >public void paint (Graphics g) {
    > g.setFont(new Font("Helvetica",Font.PLAIN,12));
    > g.drawString("Name:"+theName, 10, 250);
    > }
    >
    >Thank you for any help with this.
    >
    >Randy



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links