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.

Similar Messages

  • How to Use DLL Function in Java Applet

    Hi all,
    I have been assigned a task to develop java applet. The problem is, I need to use DLL functions in my applet to read records. Could you pls anyone guide me how to interface DLL and applet to read records with sample code?
    I'm using JDK 1.5.0_06 and Windows XP OS. thanx..
    best rgds,
    jpdbay

    You will need to use Java Native Interface JNI. Ther are many posts on the subject, please search, and this is the documentation:
    http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html

  • How to use HTML parameters in Java applet

    Hello
    In perl I have created a form with things like a selectiuon box called currency and text fields called product for example. Then when I click submit the perl program can pick up the currency and product parameters.
    I have read about applet param eg <param name="param1" value="Apple"> is this the same thing? Or is it different?
    Can I use HTML parameters or do I need to use applet param? I am confused.
    If applet param is what I need, then how do I change the param values say by editing text in a text field?

    You will need to use Java Native Interface JNI. Ther are many posts on the subject, please search, and this is the documentation:
    http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html

  • How use the jtable in java applete

    hi master
    sorry i again Disturb you
    sir pleae give me idea how i use the jtable in java applete
    please send me code
    thank's
    aamir

    Hi,
    see http://www.exampledepot.com/
    Frank

  • How to use sql query in java ?

    i don't know how to use sql query in java code.
    who can give me some advice?
    thanks

    http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/

  • How to use the structure in the EXIT_SAPMM06E_013 function module

    Hello Experts,
    Please guide me how to use the structure defined in function modules under  table tab in the driver program for smart form to fetch the data. Please post some sample code if available.
    Best Regards,
    Sandesh.Sreyamsh

    Can you please elaborate little bit more what is the actual requirement?

  • How to use "Reference Structure" setting in analysis grid item

    Hello expert,
            in Bex analyzer, how to use "Reference Structure" setting in analysis grid item by example?
    Many thanks,

    The variable needs assigned a value, that's why you're getting prompted. When you execute the statement, it's not executing the variable and exec lines.
    Having script output available in a grid would be an enhancement request.

  • How to use a structure at run time....

    Hi gurus,
    I am confused on how to use the structure in our report..why do we need it...Please help me with that...
    Thanks
    Cheers:Jim

    Or you could simply use a structure in your program to group like fields together.  So that you could maybe clear them all at one shot.
    For example, say that you have a structure with fields a - z.
    data: begin of structure,
            fielda type c,
            fieldb type c,
            fieldc type c,
            fieldz type c,
            end of structure.
    So in your program, it is now important for you to clear these fields, if you would have defined them one by one without the structure, you would have to list them all in your CLEAR statement, but instead, since you have them in a structure, you can some say....   CLEAR STRUCTURE.
    Regards,
    Rich Heilman

  • How to use event structure of event data nodes event filter nodes in programming

    hi,
    I need manual of how to use 'event structure' events of 'event data nodes' and 'event data filters'...please help me....
    Regards
    Ravindranath

    I'm not really sure what you are looking for here.  Did you do a search in the LabVIEW help for Event Structure?
    The Event Data Node just returns information about the event, like control data, control reference, what caused the event, etc.
    The Event Data Filters are just used in Filter Events.  This allows you to discard an event or change the data that the event will recieve.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to use " toFront() " method in java application and in which package or

    How to use " toFront() " method in java application and in which package or class having this toFront() method.if anybody know pl. send example.

    The API documentation has a link at the top of every page that says "Index". If you follow that and look for toFront(), you will find it exists in java.awt.Window and javax.swing.JInternalFrame.
    To use it in a Java application, create an object x of either of those two classes and write "x.toFront();".

  • How to use XML / XPath in JAVA (in 1.4) which third part component to use?

    How to use XML / XPath in JAVA (in 1.4)
    I'm absolutely novice in XML
    but I need to query XML using XPath
    As I understand XPath become avalible only in Java 1.5
    But I use 1.4 (project requirement)
    Which third part component could you recomend?

    Can anyone help me with this XPath query
    I get result [title: null]
    import java.io.*;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.w3c.dom.*;
    import org.jaxen.*;
    import org.jaxen.dom.*;
    import org.jaxen.saxpath.*;
    import java.util.*;
    public class TestX {
         public void ggg() {
              try {
                   File f = new File("journal.xml");
                   DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                   org.w3c.dom.Document doc = docBuilder.parse(f);
                   XPath xpath = new DOMXPath( "/journal/article/title" );
                   List result = (List) xpath.evaluate(doc);
                   System.out.println(result.get(0));
              } catch (Exception e) {
                       e.printStackTrace();
         public static void main(String[] args) {
              TestX tx = new TestX();
              tx.ggg();
    }journal.xml
    <journal>
        <article id="article.1">
            <title>Art1</title>
            <author>
               <first>Bob</first>
               <last>McWhirter</last>
            </author>
            <text>
            </text>
        </article>
        <article id="article.2">
            <title>Art2</title>
            <author>
               <first>James</first>
               <last>Strachan</last>
            </author>
            <text>
            </text>
        </article>
    </journal>

  • How to use openjpa  + kodo in Java SE?

    Hi.
    We are developing J2EE application on Weblogic Server 9. For a part of application we should create unit tests that will be run in Java SE. How to use openjpa + kodo in Java SE?

    Hi,
    Try the EclipseLink JPA JEE5/JEE6 provider - it has been shipping as part of WebLogic Server since 10.3.1.0.
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    The following page has several SE, application-managed and container-managed EE example tutorials with source.
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial
    http://wiki.eclipse.org/EclipseLink/Examples/JPA
    The following forum will help you with any JPA specific issues.
    Forum: TopLink/JPA
    TopLink/JPA
    thank you
    /michael
    http://www.eclipselink.org

  • How to use IE proxy with an applet and a socket ???

    Hello!
    I need to make an applet running with Internet Explorer.
    This applet uses socket and sends http request to a server (the server where the
    applet is).
    It's ok but it doesn't work when my IE uses a proxy.
    My question is: how my applet can makes a socket using the IE proxy ?
    My applet can be used by many users, so it has to work with or without proxy, and has
    no need no configuration.
    Thanks for your help.

    Check for the system environment variable for "ie.proxy" in your applet code, if it returns something then use the proxy server, if not then ignore it.
    However, as a rule of thumb unless your IE Security settings enable applets to access URLs, then it won't work. Next, speaking in general java - applets can only access resources (URLs) from the applet's originating server (i.e. the server where the applet exists).
    If IE uses a proxy, then your applet should automatically use it, unless as I metioned before, your IE Security does not allow permission for the applet to do so. Check Tools - Internet Options - Security - Java - Advanced options.

  • How i use multi panel in single applet

    hi master
    sir i need three panel in single applet
    i use this code but not set the panel
    pnl.setBounds(20, 10, 10, 20);
    and
    pnl.setLocation(12, 12);
    and
    pnl.setSize(12, 20);
    this is my class code
    JTable table = new JTable(rdata, columnNames);
    getContentPane().add(table.getTableHeader(),BorderLayout.NORTH);
    getContentPane().add(table);
    JPanel pnl = new JPanel();
    //pnl.setBounds(20, 10, 10, 20);
    //pnl.setLocation(12, 12);
    pnl.setSize(12, 20);
    pnl.add(new JScrollPane(table));
    getContentPane().add(pnl);
    //pnl.setBounds(10, 10, 10, 20);
    please sir give me idea how i use multi panel and how i set panel boundry
    thanking you
    aamir

    http://forum.java.sun.com/thread.jspa?threadID=5118094&tstart=0

  • IPAQ how to use hardware buttons in java

    Hi,
    Does anyone know how to be able to use the iPAQs harware buttons and joystick in Suns Personal Java?
    I moved a Tetris applet i have written for PC's to the iPAQ and it works except for the arrow keys that i use to control it with.
    Any help would be greatly appreciated!

    I have the same problem.
    Does anyone know how to use the buttons of the iPAQ for your java applications?
    Thanks
    Hector

Maybe you are looking for

  • Oracle 10g - Not Shutting Down in Vista Home Premium.

    Hello Guys. I installed Oracle 10gR2 successfully on Vista Home Premium.. I can even make a table which logging as a Sysdba .. but when i want to Shutdown the database, it doesn't shutdown . I re-installed Oracle 10gR2 thrice and create/delete databa

  • PO Number field disappears in transaction Display PO

    Hi SAP Gurus, I am faced with a problem in our system that when I try to display a purchase order using ME23N, the PO number does not appear in the screen. But during creation this is present. Has anyone encountered this? Thanks, Jograd

  • Voucher Number for Manual Invocies Only

    Hi All, I want to create Voucher Number to AP Manual Invoices Only in R12.1.3 Can anyone able to help me Thanks in Advance Regards, Roopa

  • 64 bit version of Firefox?

    <blockquote>Locking duplicate thread.<br> Please continue here: [[/questions/921343]]</blockquote> Is there a 64 bit version of Firefox? I downloaded what I thought was a 64 bit version, it looks and acts the same as Firefox but is called Nightly. Is

  • CMP and TO

    Hi, i'm trying to use the TO (Transfer Object) Pattern, and i used Firestorm to generate all the TOs and CMP Entity Beans I'm trying to create a new Entity Bean, and the create method for this CMP receives the TO (like it says on the Pattern). The pr