Applet question!!!

Hello there!!! I have an applet that sends text messages to a remote pc (chat application). I want to send a text message once the user closed the browser or another page is displayed or in general when the applet is no longer running. I tried to use the stop() method by it seems that it dont work even destroy()method for final clean-up. Do you know any other ways???
Thanks mate!!!

thanks arcosh!!!
yeah... I know what you mean but is there any other ways than this...??? I'm sort of saving this as my last card, hehehe!!!
Thanks anyways!!!

Similar Messages

  • Multiple-jar applet question

    Here's a basic question that none of the examples seem to address. If my applet is comprised of multiple jars (some dynamically loaded based on system configuration), do they all have to be signed, or does just the jar file containing the applet entry point need to be signed?
    Conversely, could it be that only the jar files that contain code that wants to write files to the local file system need to be signed, or does everything need to be signed?

    Conversely, could it be that only the jar files that contain code that wants to write files to
    the local file system need to be signedThe Stack needs to be "trusted" code. If an unsigned applet "not trusted" calls a method
    of the signed applet it should not be allowed to do "trusted" things.
    One example is when you call a public method of the applet from javascript. There is a
    sollution other that signing all.
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post

  • Two applet questions

    Hi there,
    I don't know if it's good to post two questions in one post, but I think it's okay since they are just small questions.
    First one: When an applet is dragged out of a browser, I have to close the browser if I want Java to ask me if I want to create a desktop shortcut. Is it possible to change this behaviour, or will it be changed in the next release?
    Second question: How can I re-integrate a JavaFX-Applet into the webpage? There seems to be no other possibility than to use that default small close button provided by Java, but I'd like to call it from the code. That must be possible?

    Yes, I tried this, but it leads to "java.lang.IllegalStateException: Can not call FX.exit() twice".
    Is there some way to do it like it is in standard java? Because there's the possibility to implement a function for the closeListener (or something like that), and then it's possible to directly call the listener to put the applet back into the page. And it hides the standard close button. Maybe we get this functionality in JFX 1.3?
    I'm currently using stage.close(), but that leads to the problems I already described.

  • PDA is under the environment of Jeode, carry out applet question with swing

    Purpose : Under the environment of Jeode in PDA, links APPLET webpage on websites, and APPLET is " import javax.swing. *".
    Question: Not knowing the problem of how to go to solve swing bug of applet , it is unable to read webpages to cause pda.

    Right. Make "number" a field, and take it out of the
    method signature for paint.
    Because you didn't use the same signature, you didn't
    override the existing paint(Graphics) method, you
    just overloaded it. That means that when the GUI
    thread tries to make your applet paint itself, it
    calls the original paint(Graphics) method, and not
    your paint(Graphics, int) method -- and so your
    method never gets called.
    Hi Paul,
    Not to sure whether is this what you mean by above statement, i just understand the statement in bold, anyway i ammend the program , this time i declare another variable outside the init() and paint() call int num
    import java.awt.*;
    import javax.swing.*;
    public class Draw extends JApplet
        int num;
        public void init()
        \\ask user for input (1, 2 or 3) = String numberStr
        num = Integer.parseInt(numberStr)
        public void paint(Graphics page)
            for (int index = 0; index < 100; index++)
            switch (num)
            \\ my statement code
    }Anyway it works, thanks..:)
    my last assigment before my exam.

  • Help - Applet Question ???

    Hi, I thought I post it yesterday, but I could not find it.
    I write a simple applet as follow:
    public class demoapplet extends Applet {
    private StringBuffer buf = new StringBuffer(1000);
    public void init() { }
    public void start() {
    //display start info
    disp("start");
    buff = processXML();
    sendHTTP(buff);
    //display start info
    disp("end");
    public void disp(string st) {
    Graphics g;
    g.drawString(st,10,60);
    public stringbuffer processXML() { ...}
    public void sendHTTP(stringbuffer buf) {... }
    My question:
    1. How to init Graphics object?
    If I use paint method, I can not pass string variable.
    2. How to send stringbuffer to another application
    via HTTP?
    3. Any problem I put my processXML and sendHTTP in start method? It only be called once when user load html page.
    Many thanks

    Hey Hi! david...
    first of all make your questions a bit more clear,
    about getting the graphics object you can get it by
    Graphics g=getGraphics();
    in the Applet.
    Also about getting the string in the paint method of the Applet. you can declare a string variable in the class and it would be accessible in the paint method.
    I first of all suggest you to get your basics right ..
    regards
    vikram

  • Specify Remote Location for PrintWriter (applet question)

    Hello,
    I am trying to use a Java applet to access a URL, read in its text content, and save it to a file. The applet is run off an online host (our school server) so I made it a signed JAR file so I could access other hosts. However, here is my problem. The applet itself is in a remote location (our school server, a unix server). I can edit the directory via SSH to add files, and these files become accessible via my homepage (where I'm running the applet from in my browser). But what I need to do is write a file IN THE SAME DIRECTORY as the applet is being run from (ie, the remote directory). But I find that when I run the applet from my browser, it instead by default saves the file I've written to in the local machine's home directory (the desktop). How can I force the applet to save/write to a file in that remote directory (I have the permissions set up on it so that non-owner can write to the directory).
    Maybe this isn't possible. I wasn't sure. Here is my code:
          //get URL containing the escape table
          URL inputURL = new URL(inputLocation);
          //make connection to the URL
          URLConnection inputCon = inputURL.openConnection();
          //save URL's contents as text file in same directory
          BufferedReader inputStream = new BufferedReader(new InputStreamReader(inputCon.getInputStream(), "UTF-8"));
          //save with same name as URL file
          File file = new File(inputURL.getFile());
          String filename = file.getName();
          PrintWriter outputStream = new PrintWriter(new File(filename), "UTF-8"); //this didn't work either: outputStream = new PrintWriter(filename, "UTF-8");
          //line of current input
          String line = null;
          //output text file to local text file line-by-line
          while((line = inputStream.readLine()) != null)
            System.out.println("line=" + line); //TEST TO MAKE SURE ACTUALLY READING FILE
            outputStream.println(line);
          }According to my System.out.println, it IS actually accessing the URL and reading each line from the URL's text file correctly, and outputStream.println(line) is correctly printing to the file; it's just doing it in the wrong place!
    Also, I should specify: I can't hard encode the file location. It could be anywhere in my html directory. Rather, I want a way to save it in the same directory as the applet was deployed from.

    It's for an assignment. All our assignments have to be applets and run from our unix server. I have to access a URL and get data from it, then create that file, then use that file as a reference table for something else.
    The tragic part is I think I have everything else working, but I've no way to test it, as I cannot figure out how to access URLs in jgrasp (my IDE - just running the java file itself as an applet within the IDE has the error message about being unable to connect to the URL, since the applet is not signed, but I've no way how to get around that within the IDE itself) so I am testing it directly on the server as a signed jar file so I can at least access the urls.
    The requirements stated:
    "make a text file (UTF-8 encoding) of the file name t in the same directory where an applet is deployed; "
    # A program must be written as an applet in Java. Other programming languages such as JavaScript cannot be used.
    # The applet must be deployed on the ITS Web server
    I could be missing something, honestly. >_< I might have a word with the TA. I'm just really frustrated since I have everything else working.

  • Another circle applet question

    I am wondering, how do I keep track of user clicks so that I can have the program set the location of the circle for the first click and then draw the radius with the second click?
    Here is what I got so far.
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.geom.Point2D;
       This program draws a user-specified triangle by clicking
          on three points
    public class ExP10_6 extends Applet
       public ExP10_6()
          clicks = 0;
          points = new Point2D.Double[MAX_CLICKS];
          MouseClickListener listener = new MouseClickListener();
          addMouseListener(listener);
       public void paint(Graphics g)
          Graphics2D g2 = (Graphics2D)g;
          circle c = new circle(clicks, points);
          c.draw(g2);
       // implement the mouse press handler
       class MouseClickListener extends MouseAdapter
          public void mousePressed(MouseEvent event)
             if (clicks >= MAX_CLICKS) return;
             int mouseX = event.getX();
             int mouseY = event.getY();
             points[clicks] = new Point2D.Double(mouseX, mouseY);
             clicks++;
             repaint();
       private int clicks;
       private Point2D.Double[] points;
       private final int MAX_CLICKS = 2;
    import java.awt.Graphics2D;
    import java.awt.geom.Ellipse2D;
    import java.awt.geom.Point2D;
    public class Circle
       public Circle(int aClick, Point2D.Double[] aPoint)
          clicks = aClick;
          points = aPoint;    
       public void draw(Graphics2D g2)
          // draw circle around first point
          if (clicks == 1)
             double x = points[0].getX();
             double y = points[0].getY();
             circle.setLocation(x, y);
          else if (clicks == 2)
             double x = points[1].getX();
             double y = points[1].getY();
       private int clicks;
       private Point2D.Double[] points;  
    }

    /*  <applet code="CircleApplet" width="400" height="400"></applet>
    *  use: >appletviewer CircleApplet.java
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.util.*;
    import java.util.List;
    public class CircleApplet extends Applet
        CirclePanel circlePanel;
        CircleSelector selector;
        public void init()
            circlePanel = new CirclePanel();
            selector = new CircleSelector(circlePanel);
            circlePanel.addMouseListener(selector);
            setLayout(new BorderLayout());
            add(getUIPanel(), "North");
            add(circlePanel);
        private Panel getUIPanel()
            Button add = new Button("add circle");
            add.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    selector.addCircle();
            Panel panel = new Panel();
            panel.add(add);
            return panel;
        public static void main(String[] args)
            Applet applet = new CircleApplet();
            Frame f = new Frame();
            f.addWindowListener(new WindowAdapter()
                public void windowClosing(WindowEvent e)
                    System.exit(0);
            f.add(applet);
            f.setSize(400,400);
            f.setLocation(200,200);
            applet.init();
            f.setVisible(true);
    class CirclePanel extends Panel
        //List<Circle> circles;                            // j2se 1.5
        List circles;                                      // j2se 1.4
        public CirclePanel()
            //circles = new ArrayList<Circle>();           // j2se 1.5
            circles = new ArrayList();                     // j2se 1.4
        public void paint(Graphics g)
            super.paint(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            for(int j = 0; j < circles.size(); j++)
                //g2.draw(circles.get(j).circle);          // j2se 1.5
                g2.draw(((Circle)circles.get(j)).circle);  // j2se 1.4
        public void addCircle(Circle c)
            circles.add(c);
            repaint();
    class CircleSelector extends MouseAdapter
        CirclePanel circlePanel;
        boolean readyToSetLocation, locationIsSet;
        Point center;
        public CircleSelector(CirclePanel cp)
            circlePanel = cp;
            readyToSetLocation = false;
            locationIsSet = false;
        public void mousePressed(MouseEvent e)
            Point p = e.getPoint();
            if(readyToSetLocation)
                center = p;
                readyToSetLocation = false;
                locationIsSet = true;
            else if(locationIsSet)
                int radius = (int)center.distance(p);
                circlePanel.addCircle(new Circle(center, radius));
                locationIsSet = false;
        public void addCircle()
            readyToSetLocation = true;
    class Circle
        Ellipse2D circle;
        public Circle(Point p, int radius)
            circle = new Ellipse2D.Double(p.x - radius, p.y - radius, 2*radius, 2*radius);
    }

  • Simple Applet Question

    Hi. I have made a simple program which asks for the users name, and then using PrintWriter writes whatever the user enters, onto a text file and so on. However, I want to use this program on my webpage, currently I am using a very simple javascript 'prompt' but i do not know how to save it to a file in javascript. So I took my code and made it into an applet (extends applet, etc...) but when i load it in a web page it says loading applet and then goes away. SO, i was wondering if somebody could please help me to make my java applet have a space where the user can enter in their name and press "ok" or whatever it may be. As always here is my code that I used...
    Please either help me to do this on my webpage with Javascript or a java applet, thanks alot ;)
    MY CODE:
    import java.io.*;
    import javax.swing.*;
    public class userNames
    public static void main(String args[])
    PrintWriter myStream = null;
    try
    myStream = new PrintWriter(new FileOutputStream("names.txt" , true));
    catch(FileNotFoundException e)
    System.out.println("Sorry, no such file");
    String askName = JOptionPane.showInputDialog("Hello, what is your name?");
    String a = "";
    String b = null;
    int count = 0;
    while(askName!=a && askName!=b)
    count++;
    myStream.println(count + ". " + askName);
    myStream.close();
    JOptionPane.showMessageDialog(null, "Thank you "+ askName+"!");
    System.exit(0);

    An applet will try to write to the local file system, ie the user who loads the page.
    That, and applets are subject to many security restrictions, File I/O being one of them. I'd suggest you give up trying this with Applet.
    HTH,
    Radish21

  • Developing a java applet questions?

    I am new to java, I want to write a java applet to do the printing for word document and pdf, is it possible, I hope that one expert can share me a good sample code .
    By the way, for developing a java applet , what development environment should I install?
    Thanks in advance.

    You can certainly generates PDF documents in Java using 3rd party, free libraries, probably .doc documents as well. Google for these and you'll find them.
    You should try Eclipse and NetBeans. Both are free and widely used for Java development.

  • Extremely Advanced applet question

    hello,
    I am developing a JComponent, and it works
    great as long as I don't run it as an applet.
    I have overloaded the add, and remove functions
    that get inherited from Container. I notice
    that when I run my JComponent as an applet,
    it runs fine the first time, than I restart the applet.
    This proceeds to add components to the JComponent
    but something is calling the remove function also
    and really screwing things up.
    More concretely:
    I have developed say a JHolder, which you can add components to. Every time you do however, I add a
    brother component with it that I made called JBrother
    (REMEMBER, this works fine when run except in applets).
    Every time you remove a component it's respective JBrother comp is removed.(I only overload the remove(comp) function, not remove(index), and not removeAll() which work fine.
    Code snippet and debug output(from add and remove functions)
    JButton A = new button("A");
    JButton B = new button("B");
    JHolder.add(A);
    JHolder.add(B);
    Now, once I RESTART the applet(starting it works fine)
    here is the debug trace I have...
    button A is added;
    button A is removed;//ahhhh, why?????
    JBrother is removed;
    JBrother is added;
    button B is added;
    button B is removed;
    JBrother is removed;
    JBrother is added;
    This never happens in a java program, only applets, probably because you can't restart a program like in the web browser where you can go back and forward which restarts your applet instead of reloading it.
    as you can see, this is really whacky? DOES ANYBODY KNOW WHAT THE HECK IS GOING ON??

    I think you allready said the answer: the applet is not realy reloaded, its just restarted.
    So my suggestin is, that the parent of A is still your holder, adding it to an container it will be removed from its former parent (from your holder).
    You should call removeAll or something like this before adding it.
    Hope this helps (I really don't know)...

  • Swing Applet question

    I would like to know why the look and feel for Swing applet (especially, Text information embedded in JPanels) are different on Windows 2000 and XP embedded versions. The text information is left aligned in XP embedded when the same is centrally aligned in the 2000 version. In XP embedded, the applet is expanding beyond the screen size bounds. Is there anything I can do so that look and feel are the same in both these OS's.
    Regards, Scr

    nitroniouz wrote:
    (which don't work when you click on them)Are they freeze? The buttons don't react to the clicks or they seam to work but don't execute the expected function?
    I think that your actSignup actionPerfomed methos is not working well or it's taking too long to execute and you're blocking the EDT.
    Try to create a separate thread to do the database task, a SwingWorker may help you. Take a look at the [Cocurrency in Swing Tutorial|http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html].
    Regards,
    Henrique Abreu

  • Question please help as soon as possible if you can-- Applet question

    Is there a way to separate a string onto different lines when you draw a string to the applet like there is with escape sequences in a regular application? Thanks

    ok my apologies, I'm not great at explaining things...I have a loop to generate and shuffle a deck of cards. The loop also generates a random number which is equal to a certain string value. Here I'll just show you the code...it will be easier that way:
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.util.Random;
    import java.lang.*;
    public class CardGame extends Applet implements ActionListener {
         Button Deal;
         Button NewGame;
         Button PutDown;
         Button PickUp;
         Color bgColor;
         Color rectColor;
         Image deck;
         MediaTracker mt;
         CheckboxGroup radioGroup;
         Checkbox radio1;
         Checkbox radio2;
         Checkbox radio3;
         Checkbox radio4;
         Checkbox radio5;
         Checkbox radio6;
         Checkbox radio7;
         Checkbox radio8;
    //     String[] faceValue = {"ACE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN", "JACK", "QUEEN", "KING"};
    //     String[] suitValue = {"CLUBS", "HEARTS", "SPADES", "DIAMONDS"};
         int rndFaceValue;
         int rndmSuitValue;
         int[] valueArray = new int[52];
         String[] array = new String[52];
         int[] indexArray = new int[8];
         int i;
         int w;
         String card1;
         String card2;
         String card3;
         String card4;
         String card5;
         String card6;
         String card7;
         String card8;
         String cardOnTable;
         String checkRad;
         String removeCard;
         public void init()
              setLayout(null);
              setSize(1000, 600);     
              mt = new MediaTracker(this);
              Deal = new Button("Deal");
              NewGame = new Button("New Game");
              PutDown = new Button("Put Down");
              PickUp = new Button("Pick Up");
              Deal.setBounds(750, 450, 75, 25);
              NewGame.setBounds(750, 475, 75, 25);
              PutDown.setBounds(750, 425, 75, 25);
              PickUp.setBounds(750, 400, 75, 25);
              add(Deal);
              add(NewGame);
              add(PutDown);
              add(PickUp);
              Deal.addActionListener(this);
              NewGame.addActionListener(this);
              PutDown.addActionListener(this);
              PickUp.addActionListener(this);
              PutDown.setEnabled(false);
              PickUp.setEnabled(false);
              radioGroup = new CheckboxGroup();
              radio1 = new Checkbox(" ", radioGroup, false);
              radio2 = new Checkbox(" ", radioGroup, false);
              radio3 = new Checkbox(" ", radioGroup, false);
              radio4 = new Checkbox(" ", radioGroup, false);
              radio5 = new Checkbox(" ", radioGroup, false);
              radio6 = new Checkbox(" ", radioGroup, false);
              radio7 = new Checkbox(" ", radioGroup, false);
              radio8 = new Checkbox(" ", radioGroup, true);
              add(radio1);
              add(radio2);
              add(radio3);
              add(radio4);
              add(radio5);
              add(radio6);
              add(radio7);
              add(radio8);
              radio1.setBounds(143, 525, 10, 10);
              radio2.setBounds(222, 525, 10, 10);
              radio3.setBounds(301, 525, 10, 10);
              radio4.setBounds(380, 525, 10, 10);
              radio5.setBounds(459, 525, 10, 10);
              radio6.setBounds(538, 525, 10, 10);
              radio7.setBounds(617, 525, 10, 10);
              radio8.setBounds(840, 385, 10, 10);
                   Random generator = new Random();
              int rndmNum = generator.nextInt(52) + 1;
         //     int[] valueArray = new int[52];
         //     String[] array = new String[52];
         //     int i;
              for(i=0; i<52; i++)
                   int nRND = rndmNum;
                   boolean valueUsed = false;
                   boolean okToGo = false;
                   while(valueUsed == false && okToGo == false)
                        for(int x = 0; x < i+1; x++)
                             if (valueArray[x] == nRND)
                                  valueUsed = true;
                                  x = i;
                        if (valueUsed == true)
                             nRND = generator.nextInt(52) + 1;
                             valueUsed = false;
                        else
                             okToGo = true;
                             valueArray[i] = nRND;
                   if (nRND == 1)
                        array[i] = "Ace of Clubs";
                   if (nRND == 2)
                        array[i] = "Two of Clubs";
                   if (nRND == 3)
                        array[i] = "Three of Clubs";
                   if (nRND == 4)
                        array[i] = "Four of Clubs";
                   if (nRND == 5)
                        array[i] = "Five of Clubs";
                   if (nRND == 6)
                        array[i] = "Six of Clubs";
                   if (nRND == 7)
                        array[i] = "Seven of Clubs";
                   if (nRND == 8)
                        array[i] = "Eight of Clubs";
                   if (nRND == 9)
                        array[i] = "Nine of Clubs";
                   if (nRND == 10)
                        array[i] = "Ten of Clubs";
                   if (nRND == 11)
                        array[i] = "Jack of Clubs";
                   if (nRND == 12)
                        array[i] = "Queen of Clubs";
                   if (nRND == 13)
                        array[i] = "King of Clubs";
                   if (nRND == 14)
                        array[i] = "Ace of Hearts";
                   if (nRND == 15)
                        array[i] = "Two of Hearts";
                   if (nRND == 16)
                        array[i] = "Three of Hearts";
                   if (nRND == 17)
                        array[i] = "Four of Hearts";
                   if (nRND == 18)
                        array[i] = "Five of Hearts";
                   if (nRND == 19)
                        array[i] = "Six of Hearts";
                   if (nRND == 20)
                        array[i] = "Seven of Hearts";
                   if (nRND == 21)
                        array[i] = "Eight of Hearts";
                   if (nRND == 22)
                        array[i] = "Nine of Hearts";
                   if (nRND == 23)
                        array[i] = "Ten of Hearts";
                   if (nRND == 24)
                        array[i] = "Jack of Hearts";
                   if (nRND == 25)
                        array[i] = "Queen of Hearts";
                   if (nRND == 26)
                        array[i] = "King of Hearts";
                   if (nRND == 27)
                        array[i] = "Ace of Spades";
                   if (nRND == 28)
                        array[i] = "Two of Spades";
                   if (nRND == 29)
                        array[i] = "Three of Spades";
                   if (nRND == 30)
                        array[i] = "Four of Spades";
                   if (nRND == 31)
                        array[i] = "Five of Spades";
                   if (nRND == 32)
                        array[i] = "Six of Spades";
                   if (nRND == 33)
                        array[i] = "Seven of Spades";
                   if (nRND == 34)
                        array[i] = "Eight of Spades";
                   if (nRND == 35)
                        array[i] = "Nine of Spades";
                   if (nRND == 36)
                        array[i] = "Ten of Spades";
                   if (nRND == 37)
                        array[i] = "Jack of Spades";
                   if (nRND == 38)
                        array[i] = "Queen of Spades";
                   if (nRND == 39)
                        array[i] = "King of Spades";
                   if (nRND == 40)
                        array[i] = "Ace of Diamonds";
                   if (nRND == 41)
                        array[i] = "Two of Diamonds";
                   if (nRND == 42)
                        array[i] = "Three of Diamonds";
                   if (nRND == 43)
                        array[i] = "Four of Diamonds";
                   if (nRND == 44)
                        array[i] = "Five of Diamonds";
                   if (nRND == 45)
                        array[i] = "Six of Diamonds";
                   if (nRND == 46)
                        array[i] = "Seven of Diamonds";
                   if (nRND == 47)
                        array[i] = "Eight of Diamonds";
                   if (nRND == 48)
                        array[i] = "Nine of Diamonds";
                   if (nRND == 49)
                        array[i] = "Ten of Diamonds";
                   if (nRND == 50)
                        array[i] = "Jack of Diamonds";
                   if (nRND == 51)
                        array[i] = "Queen of Diamonds";
                   if (nRND == 52)
                        array[i] = "King of Diamonds";
         public void actionPerformed(ActionEvent evt)
              if(evt.getSource() == Deal)
                   card1 = array[0];
                   card2 = array[1];
                   card3 = array[2];
                   card4 = array[3];
                   card5 = array[4];
                   card6 = array[5];
                   card7 = array[6];
                   cardOnTable = array[7];
                   indexArray[0] = 0;
                   indexArray[1] = 1;
                   indexArray[2] = 2;
                   indexArray[3] = 3;
                   indexArray[4] = 4;
                   indexArray[5] = 5;
                   indexArray[6] = 6;
              //     indexArray[7] = 0;
                   w = 8;
                   Deal.setEnabled(false);
                   PickUp.setEnabled(true);
                   repaint();
              if (evt.getSource() == PutDown)
                   if(radio1.getState())
                        checkRad = array[indexArray[0]];
                        card1 =" ";
                        cardOnTable = " ";
                   else if(radio2.getState())
                        checkRad = array[indexArray[1]];
                        card2 =" ";
                        cardOnTable = " ";
                   else if(radio3.getState())
                        checkRad = array[indexArray[2]];
                        card3 =" ";
                        cardOnTable = " ";
                   else if(radio4.getState())
                        checkRad = array[indexArray[3]];
                        card4 =" ";
                        cardOnTable = " ";
                   else if(radio5.getState())
                        checkRad = array[indexArray[4]];
                        card5 =" ";
                        cardOnTable = " ";
                   else if(radio6.getState())
                        checkRad = array[indexArray[5]];
                        card6 =" ";
                        cardOnTable = " ";
                   else if(radio7.getState())
                        checkRad = array[indexArray[6]];
                        card7 =" ";
                        cardOnTable = " ";
                   repaint();
                   PutDown.setEnabled(false);
              if (evt.getSource() == PickUp)
                   if(radio8.getState())
                        card8 = array[w];
                        indexArray[0] = w;
                        w = w + 1;
                        repaint();
                   PickUp.setEnabled(true);
         public void paint(Graphics g) {
              g.drawString("Card Pending Approval", 780, 250);
              g.drawString("Welcome to Rummy!!", 300, 50 );
              g.drawRect(100, 100, 600, 440);
              g.drawRect(110, 420, 75, 100);
              g.drawRect(190, 420, 75, 100);
              g.drawRect(270, 420, 75, 100);
              g.drawRect(350, 420, 75, 100);
              g.drawRect(430, 420, 75, 100);
              g.drawRect(510, 420, 75, 100);
              g.drawRect(590, 420, 75, 100);
              g.drawRect(110, 120, 75, 100);
              g.drawRect(190, 120, 75, 100);
              g.drawRect(270, 120, 75, 100);
              g.drawRect(350, 120, 75, 100);
              g.drawRect(430, 120, 75, 100);
              g.drawRect(510, 120, 75, 100);
              g.drawRect(590, 120, 75, 100);
              g.drawRect(300, 250, 75, 100);
              g.drawRect(380, 250, 75, 100);
              //pending card
              g.drawRect(810, 280, 75, 100);
              g.drawString(card1, 115, 450);
              g.drawString(card2, 195, 450);
              g.drawString(card3, 275, 450);
              g.drawString(card4, 355, 450);
              g.drawString(card5, 435, 450);
              g.drawString(card6, 515, 450);
              g.drawString(card7, 595, 450);
              g.drawString(cardOnTable, 390, 275);
              g.drawString(card8, 810, 325);
              g.drawString(checkRad, 390, 275);
    now i know this is probably written in the worst of ways, but I'm only in HS just learning so please don't mind my awful coding. :)
    Also in the code there is a bracketed i in the loop where it converts the number to a string for all 52 of them i dont know why it did not copy them.
    Message was edited by:
    mphamma8

  • [SOLVED] KDE Applet Question

    Hi All,
    I have read the Arch wiki KDE page several times now and there is something I just can't work out.
    I have NetworkManager installed (not KnetworkManager).
    I also have kdeplasma-applet-networkmanagement installed.
    however, I can't any applet's working.
    typing nm-applet returns command not found at the terminal.
    and I have no /etc/xdg/autostart/nm-applet.desktop file...
    Any ideas what I'm doing wrong?
    Many Thanks
    Last edited by Sidhartha (2012-01-28 17:54:34)

    nm-applet is gnome's network-manager-applet. kdeplasma-applet-networkmanagement works like other plasma applets - you have to add it to the panel or the notification area.

  • Client server applet question

    Hello I have a client and server program on computer a and computer b.
    I want a webpage with a java applet.
    I want that if I push a button in the client the java applet gets a message.
    I want that the server looks for changes in the applet and when there is a change the server does something.
    I have a program where the client and server communicate with eachother but how can I make a program like I want?
    How can I send a message to the applet(on a webpage) from the client and how can I look at the applet with my server??

    Aplet runs on client side (in other words on PC which is used to view page). On server side it is stored only as any other kind of file. To be able to create "client-server" solution you have to be able to run code also on server machine. I did not found any free hosting server which allows to run java. But in many cases they allow to use PHP which runs enteirly on server side. Check for this - it may be right solution for you.

  • Applet question, how to download resource files from server

    hi,
    i am new at applet world.
    i have an applet that reads some resource, data and configuration files. so i need to download these files from server to client. i did some resarch and could not find how to download files from server in an applet application.
    how can i do this task?
    thank you for your answers.

    You may want to distinguish between 'resources' and data/configuration files.
    'Resources' are non-class files that are part of your application, i.e without them the application would simply not work, just like class files.
    Those are typically images, sounds or resource bundles (GUI elements translated to different languages) that nobody except you, the developer, would touch (when releasing an upgrade or a patch).
    Those should just go into the applet jar or additional jars named in the applet tag.
    Data/configuration files, that may be changed by others than the developers, should be made available through HTTP, just like the applet jar itself. The applet will have (read) access to them using java.net.URLConnection.

Maybe you are looking for

  • Error while deleting a mapping

    Hi all, I am getting the following error while deleting a mapping. My client version is 10.2.0.4.36 API5072: Internal Error: Null message for exception. Please contact Oracle Support with the stack trace and details on how to reproduce it. oracle.wh.

  • Popup blocker issue when trying to open XML publisher report in Excel forma

    Hello I am having the XML report in excel format, when i click on output it was blocking by popup blocker i think and when i click 'Control' button on my keyboard and then press the output it will show the window to save or open the excel. I have add

  • InDesign 5.0 tools/panels not activated with mouseover/mouseclick

    The following summarizes the hardware, software, procedures and results in my attempt to resolve issues with InDesign 5.0. Suggestions would be appreciated. Thanks! System: HP EliteBook 8540W Intel Core i7 CPU  Q820 @ 1.73GHz 1.73 GHz 8 GB 64-bit Ope

  • Problem in choosing the datasources

    Hi Bwers,          I need to give an monthly performance Report on PP. Can you please let me know wether these fields are from PP only orelse I need to go for any other modules for datasources. Please let me know generally which standard datasources,

  • IDXNOALE - table is populated automatically

    Hi every one, I am working on Idoc - XI - Idoc scenario, whenever I send an Idoc from R/3 to XI, the IDXNOALE - table is populated automatically. Y is this. Can anyone please explain this? -Naveen.