Need help on Applet Programming

Hi all,
I have 2 java file,
The main file is "Kell.java" and the second file is "MyFrame.java".
I have call the Myframe.java when i pressed "Booking" button on the Kell.java, but I did know how to call the action listener for      private class searchBtnListener implements ActionListener from the Kell.java.
Other problem is how i want to change value of lblresult in MyFrame.java when i pressed Search button.
Can anyone help me?
Kell.java
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;
import java.text.DecimalFormat;
import java.applet.*;
public class Kell extends JApplet {
    private JPanel parentPanel, titlePanel, orderPanel;
    private JPanel bottomPanel, titleAndMenuPanel;
      private JPanel menuBtnPanel;
    private JLabel lblTitle, lblDesc;
      private JButton bookingBtn, scheduleBtn, verifyBtn;
    private ButtonGroup menuUtamaBtn;
      private CardLayout card;
JPanel cards;
     // Applet Size
     private final Dimension appletSize = new Dimension(500, 500);
    public void init()
        // set applet size
        this.setSize(appletSize);
        * Create Panels
        parentPanel = new JPanel();
            orderPanel = new JPanel();
            titlePanel = new JPanel();
            titleAndMenuPanel = new JPanel();
            menuBtnPanel = new JPanel();
        bottomPanel = new JPanel();
        * Set Panel Layouts
            titleAndMenuPanel.setLayout(new GridLayout(2,1));
        parentPanel.setLayout(new BorderLayout());
        titlePanel.setLayout(new BoxLayout(titlePanel, BoxLayout.Y_AXIS));
        orderPanel.setLayout(new BoxLayout(orderPanel, BoxLayout.Y_AXIS));
            menuBtnPanel.setLayout(new GridLayout(1,3));
        //bottomPanel.setLayout(new BorderLayout(5,5));
        // Title
        lblTitle = new JLabel("Bookiing OnnnLiine");
        lblTitle.setFont (new Font ("Book Antiqua", Font.BOLD, 18));
        lblTitle.setAlignmentX(Component.CENTER_ALIGNMENT);
        titlePanel.add(lblTitle);
        lblDesc = new JLabel("This is the online system that....");
        lblDesc.setFont (new Font ("Book Antiqua", Font.BOLD, 18));
        lblDesc.setAlignmentX(Component.CENTER_ALIGNMENT);
        orderPanel.add(lblDesc);
           // Button
            menuUtamaBtn = new ButtonGroup();
        bookingBtn = new JButton("Booking");
        scheduleBtn = new JButton("Schedule");
        verifyBtn = new JButton("Verify");
            menuUtamaBtn.add(bookingBtn);
        menuUtamaBtn.add(scheduleBtn);
        menuUtamaBtn.add(verifyBtn);
        bookingBtn.addActionListener(new bookingBtnListener());
      //scheduleBtn.addActionListener(new scheduleBtnListener());
      //verifyBtn.addActionListener(new verifyBtnListener());
        menuBtnPanel.add(bookingBtn);
        menuBtnPanel.add(scheduleBtn);
        menuBtnPanel.add(verifyBtn);
         * Add Panels
            titleAndMenuPanel.add(titlePanel, BorderLayout.NORTH);
            titleAndMenuPanel.add(menuBtnPanel, BorderLayout.SOUTH);
        parentPanel.add(titleAndMenuPanel, BorderLayout.NORTH);
            parentPanel.add(orderPanel, BorderLayout.CENTER);
        parentPanel.add(bottomPanel, BorderLayout.SOUTH);
        add(parentPanel);
     * Listeners
      private class bookingBtnListener implements ActionListener {
        public void actionPerformed (ActionEvent event) {
               MyFrame booking = new MyFrame();
               parentPanel.add(booking.bookingPANEL(), BorderLayout.CENTER);
               parentPanel.validate() ;
}MyFrame.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MyFrame
     JLabel lblresult;
     public JPanel bookingPANEL()
          JPanel bookingP = new JPanel();
          JPanel searchP = new JPanel();
          JPanel resultP = new JPanel();
          JButton searchBtn = new JButton("Search");
          bookingP.setLayout(new GridLayout(2,1));
          searchP.setLayout(new BoxLayout(searchP, BoxLayout.Y_AXIS));
          resultP.setLayout(new BorderLayout());
          JLabel lblDesc = new JLabel("Testing Booking Panel");
          lblDesc.setFont (new Font ("Book Antiqua", Font.BOLD, 18));
          lblDesc.setAlignmentX(Component.CENTER_ALIGNMENT);
          lblresult = new JLabel("Testing Search Button");
          lblresult.setFont (new Font ("Book Antiqua", Font.BOLD, 18));
          lblresult.setAlignmentX(Component.CENTER_ALIGNMENT);
          searchP.add(lblDesc);
          searchP.add(searchBtn);
          resultP.add(lblresult, BorderLayout.NORTH);
          bookingP.add(searchP, 0);
          bookingP.add(resultP, 1);
          searchBtn.addActionListener(new searchBtnListener());
          return bookingP;
     private class searchBtnListener implements ActionListener {
        public void actionPerformed (ActionEvent event) {
               // I dont know how to change the value of lblresult     
               //     lblresult.text = "Button has been pressed.";
}

Other problem is how i want to change value of
lblresult in MyFrame.java when i pressed
Search button.
private class searchBtnListener implements
s ActionListener {
public void actionPerformed (ActionEvent
event) {
// I dont know how to change the value of
of lblresult     
               //     lblresult.text = "Button has been pressed.";
}lblresult.setText(" new String value") ;

Similar Messages

  • Need help writing host program using LabView.

    Need help writing host program using LabView.
    Hello,
    I'm designing a HID device, and I want to write a host program using National Instrument's LabView. NI doesn't have any software support for USB, so I'm trying to write a few C dll files and link them to Call Library Functions. NI has some documentation on how to do this, but it's not exactly easy reading.
    I've written a few C console programs (running Win 2K) using the PC host software example for a HID device from John Hyde's book "USB by design", and they run ok. From Hyde's example program, I've written a few functions that use a few API functions each. This makes the main program more streamlined. The functions are; GetHIDPath, OpenHID, GetHIDInfo, Writ
    eHID, ReadHIC, and CloseHID. As I mentioned, my main program runs well with these functions.
    My strategy is to make dll files from these functions and load them into LabView Call Library Functions. However, I'm having a number of subtle problems in trying to do this. The big problem I'm having now are build errors when I try to build to a dll.
    I'm writing this post for a few reasons. First, I'm wondering if there are any LabView programmers who have already written USB HID host programs, and if they could give me some advice. Or, I would be grateful if a LabView or Visual C programmer could help me work out the programming problems that I'm having with my current program. If I get this LabView program working I would be happy to share it. I'm also wondering if there might already be any USB IHD LabView that I could download.
    Any help would be appreciated.
    Regards, George
    George Dorian
    Sutter Instruments
    51 Digital DR.
    Novato, CA 94949
    USA
    [email protected]
    m
    (415) 883-0128
    FAX (415) 883-0572

    George may not answer you.  He hasn't been online here for almost eight years.
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • Need help with applet servlet communication .. not able to get OutputStream

    i am facing problem with applet and servlet communication. i need to send few image files from my applet to the servlet to save those images in DB.
    i need help with sending image data to my servlet.
    below is my sample program which i am trying.
    java source code which i am using in my applet ..
    public class Test {
        public static void main(String argv[]) {
            try {
                    URL serverURL = new URL("http://localhost:8084/uploadApp/TestServlet");
                    URLConnection connection = serverURL.openConnection();
                    Intermediate value=new Intermediate();
                    value.setUserId("user123");
                    connection.setDoInput(true);
                    connection.setDoOutput(true);
                    connection.setUseCaches(false);
                    connection.setDefaultUseCaches(false);
                    // Specify the content type that we will send binary data
                    connection.setRequestProperty ("Content-Type", "application/octet-stream");
                    ObjectOutputStream outputStream = new ObjectOutputStream(connection.getOutputStream());
                    outputStream.writeObject(value);
                    outputStream.flush();
                    outputStream.close();
                } catch (MalformedURLException ex) {
                    System.out.println(ex.getMessage());
                }  catch (IOException ex) {
                        System.out.println(ex.getMessage());
    }servlet code here ..
    public class TestServlet extends HttpServlet {
         * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
         * @throws ServletException if a servlet-specific error occurs
         * @throws IOException if an I/O error occurs
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
             System.out.println(" in servlet -----------");
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            ObjectInputStream inputFromApplet = null;
            Intermediate aStudent = null;
            BufferedReader inTest = null;
            try {         
                // get an input stream from the applet
                inputFromApplet = new ObjectInputStream(request.getInputStream());
                // read the serialized object data from applet
                data = (Intermediate) inputFromApplet.readObject();
                System.out.println("userid in servlet -----------"+ data.getUserId());
                inputFromApplet.close();
            } catch (Exception e) {
                e.printStackTrace();
                System.err.println("WARNING! filename.path JNDI not found");
            } finally {
                out.close();
        @Override
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            System.out.println(" in foGet -----------");
            processRequest(request, response);
         * Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
         * @throws ServletException if a servlet-specific error occurs
         * @throws IOException if an I/O error occurs
        @Override
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            System.out.println(" in doPost -----------");
            processRequest(request, response);
         * Returns a short description of the servlet.
         * @return a String containing servlet description
        @Override
        public String getServletInfo() {
            return "Short description";
        }// </editor-fold>
    }the Intermediate class ..
    import java.io.Serializable;
    public class Intermediate implements Serializable{
    String userId;
        public String getUserId() {
            return userId;
        public void setUserId(String userId) {
            this.userId = userId;
    }

    Hi,
    well i am not able to get any value from connection.getOutputStream() and i doubt my applet is not able to hit the servlet. could you review my code and tell me if it has some bug somewhere. and more over i want to know how to send multiple file data from applet to servlet . i want some sample or example if possible.
    do share if you have any experience of this sort..
    Thanks.

  • Hi there, need help for this program...thx!

    Hi there guys,
    I have created this applet program that requires a user to login with a user no, and a password. I am using arrays as to store the defined variables,(as required by my project supervisor). My problem here is that when the arrays are declared in class validateUser(), the program would run fine, but i cant login and i get a NullPointerException error. if the arrays are located in actionPerformed, i get a 'cannot resolve symbol' error for the method 'get' and 'if (Admin.equals(admins.get(i).toString())) ' as well as 'if (Password.equals(passwordsget(i).toString())) '. I am not very effecient in java, hence the untidy program (and i have to admit, it isnt any good), so sorry for any inconvenience caused. Once agani thx in advance ;)
    here are my codings :
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.URL;
    import java.net.*;
    import javax.swing.*;
    import java.lang.*;
    import java.util.Vector;
    public class eg31662 extends Applet implements ActionListener
         Panel panel1, panel2, panel3, panel4, panel5;
         Button login, enter;
         Label inst, top, admin, pass, fieldlabel;
    TextField adminF, passF, field;
    String Admin, Password;
    Vector admins, passwords;
         Thread thread = null;
         boolean status = false;
              public class validateUser extends Applet
                   String[] admins = {"User1", "User2", "User3"};
                   String[] passwords = {"P1", "P2", "P2"};
         public void init()
              setLayout (new BorderLayout());
              panel1 = new Panel(new FlowLayout());
              panel2 = new Panel(new FlowLayout());
              //login button
              login = new Button("Login");
              //instruction
              inst = new Label("Please type in your User no. and the given password in order to proceed");
              //label
              top = new Label("Login login");
              admin = new Label("Admin No :");
              pass = new Label("Password :");
              //input textfields
              adminF = new TextField(8);
              passF = new TextField(10);
              passF.setEchoChar('*');
              panel1.setBackground(Color.gray);
              panel2.setBackground(Color.orange);
              panel2.add(admin);
              panel2.add(adminF);
              panel2.add(pass);
              panel2.add(passF);
              panel2.add(login);
              panel2.add(inst);
              panel1.add(top);
              add(panel1, BorderLayout.NORTH);
              add(panel2, BorderLayout.CENTER);
              login.addActionListener(this);
              setSize(500,400);
         void mainpage()
              boolean flag = true;
              setLayout (new BorderLayout());
              panel1 = new Panel(new FlowLayout());
              panel2 = new Panel(new FlowLayout());
              top = new Label("Welcome");
              enter = new Button("Enter");
              panel2.setBackground(Color.orange);
              panel1.setBackground(Color.gray);
              fieldlabel = new Label("Type something here :");
              field = new TextField(20);
              add(panel1, BorderLayout.NORTH);
              add(panel2, BorderLayout.CENTER);
              panel2.add(fieldlabel);
              panel2.add(field);
              enter.addActionListener(this);
         public void start() {
              if(thread == null) {
                   status = true;
         public void stop() {
              status = false;
         public void run() {
              while(status == true) {
                   try {
                        thread.sleep(50);
                   catch(InterruptedException ie) {
                   repaint();
              thread = null;
         public void actionPerformed(ActionEvent ev)
                   //String[] admins = {"User1", "User2", "User3"};
                   //String[] passwords = {"P1", "P2", "P3"};
              if(ev.getSource() == login)
                   Admin = adminF.getText();
                   Password = passF.getText();
              boolean ok = true;
              for (int i = 0; i < admins.size(); i++) {
              if (Admin.equals(admins.get(i).toString())) {
              if (Password.equals(passwords.get(i).toString())) {
              ok = true;
              this.setVisible(false);
              //break;
                             JOptionPane.showMessageDialog(null, "Welcome, u have successfully logged in");
                             mainpage();
              else {
              ok = false;
              else {
              ok = false;
              if (ok == false) {
                             JOptionPane.showMessageDialog(null,
                        "Incorrect Password or Admin No, Please Try Again",
                        "Access Denied",
                        JOptionPane.ERROR_MESSAGE);
              else {
              this.setVisible(false);
    }

    Hi, sorry to bring this thread up again, but this is actually a continuation from my previous posted program. Hope u guys can help me again!
    Right now i'm supposed to come up with a simple quiz program, which consists of the center panel displayin the question (in a pic format), and a textfield to enter the answer at the lower panel. this goes on for a couple of pages and once it is completed, the final page would display the total correct answers out of the number of questions, as well as the score in percentage form.
    The few(or many) problems taht i'm facing are :
    1)How do i save the answers that are typed in each textfieldAnd later on checked for the correct answer based on the array given?
    2)How do i go about doing the final score in percentage form and total of correct answers?
    3)I previously tried out using canvas, but it didnt seem to work. my questions(pictures) that are supposed to displayed in the center(canvas) produce nothing. How do i rectify that?
    i'm really sorry for the mess in the codings, hope this wouldnt be a hassle for any of u out there. Once again thanks in advance!
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.URL;
    import java.net.*;
    import java.util.Vector;
    import javax.swing.*;
    import java.awt.image.*;
    import java.lang.*;
    import java.awt.Graphics;
    public class eg31662 extends Applet implements ActionListener
        Panel panel1, panel2, panel3, panel4, panel5;
        Button login, enter;
        Label inst, top, admin, pass, startLabel;
        TextField adminF, passF, field;
        String Admin, Password;
        Vector admins, passwords;
         //Quiz declarations
         TextField ansF1,ansF2,ansF3;
         Button startBut, next0, next1, finishB, previous1;
         Image q1, q2, q3;
         Image ques[] = new Image[2];
         boolean text = false;
         boolean checked = false;
         int correct = 0;
         String [] answer = new String [2];
         String [] solution = {"11", "22", "33"};
         boolean text = false;
         boolean sound = true;
         int red,green,blue;
         int question =0;
         int good = 0;
         boolean pause= false;
         boolean start = true;*/
        Thread thread = null;
        boolean status = false;
        public void init()
            validateUser();
            setLayout (new BorderLayout());
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
            panel3 = new Panel(new FlowLayout());
            //login button
            login = new Button("Login");
            //instruction
            inst = new Label("Please type in your UserName and the given " +
                             "password in order to proceed");
            //label
            top = new Label("Top Label");
            admin = new Label("User Name :");
            pass = new Label("Password :");
            //input textfields
            adminF = new TextField(8);
            passF = new TextField(10);
            passF.setEchoChar('*');
            panel1.setBackground(Color.gray);
            panel2.setBackground(Color.orange);
              panel3.setBackground(Color.gray);
            panel2.add(admin);
            panel2.add(adminF);
            panel2.add(pass);
            panel2.add(passF);
            panel2.add(login);
            panel3.add(inst);
            panel1.add(top);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
            login.addActionListener(this);
            setSize(500,400);
        private void validateUser()
            String[] adminData    = {"t", "User1", "User2", "User3"};
            String[] passwordData = {"t", "P1", "P2", "P3"};
            admins = new Vector();
            passwords = new Vector();
            for(int j = 0; j < adminData.length; j++)
                admins.add(adminData[j]);
                passwords.add(passwordData[j]);
        private void Mainpage()
            boolean flag = true;
            removeAll();  // remove all components from container
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
              panel3 = new Panel(new FlowLayout());
            top = new Label("Welcome");
            enter = new Button("Enter");
            panel2.setBackground(Color.orange);
            panel1.setBackground(Color.gray);
            panel3.setBackground(Color.gray);
            startLabel = new Label("Welcome! " +
                                          "Please click on the 'Start' button to begin the quiz ");
              startBut = new Button("Start");
              startBut.requestFocus();
              Dimension dim = getSize();
              startBut.setSize(50,20);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
            panel2.add(startLabel);
            panel2.add(startBut);
            startBut.addActionListener(this);
            validate();
            repaint();
        private void Quiz1()
              //quizCanvas = new Canvas();
            boolean flag = true;
            removeAll();  // remove all components from container
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
            panel3 = new Panel(new FlowLayout());
            panel1.setBackground(Color.gray);
            panel2.setBackground(Color.orange);
            panel3.setBackground(Color.gray);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
              q1 = getImage(getDocumentBase(), "1.gif");
              ques[0] = q1;
              //ques[1] = q2;
              //previous = new Button("<");
              next0 = new Button("Done");
            ansF1 = new TextField(25);
              next0.addActionListener(this);
              //quizCanvas.insert(ques1);
            //panel3.add(previous);
            panel3.add(next0);
            panel3.add(ansF1);
            //panel2.add("1.gif");
              ansF1.requestFocus();
              ansF1.setText("focussing");
            validate();
            repaint();
         public void Quiz2(){
            boolean flag = true;
            removeAll();  // remove all components from container
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
            panel3 = new Panel(new FlowLayout());
            panel1.setBackground(Color.gray);
            panel2.setBackground(Color.orange);
            panel3.setBackground(Color.gray);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
              q2 = getImage(getDocumentBase(), "2.gif");
              ques[1] = q2;
              next1 = new Button("Done");
            ansF2 = new TextField(25);
              next1.addActionListener(this);
            panel3.add(next1);
            panel3.add(ansF2);
              ansF2.requestFocus();
              ansF2.setText("focussing");
            validate();
            repaint();
         public void Quiz3(){
            boolean flag = true;
            removeAll();  // remove all components from container
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
            panel3 = new Panel(new FlowLayout());
            panel1.setBackground(Color.gray);
            panel2.setBackground(Color.orange);
            panel3.setBackground(Color.gray);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
              q3 = getImage(getDocumentBase(), "3.gif");
              ques[2] = q3;
              finishB = new Button("Finish");
            ansF3 = new TextField(25);
              finishB.addActionListener(this);
            panel3.add(finishB);
            panel3.add(ansF3);
              ansF3.requestFocus();
              ansF3.setText("focussing");
            validate();
            repaint();
        public void start() {
            if(thread == null) {
                status = true;
        public void stop() {
            status = false;
        public void actionPerformed(ActionEvent ev)
            boolean ok = true;
            if(ev.getSource() == login)
                Admin = adminF.getText();
                Password = passF.getText();
                for (int i = 0; i < admins.size(); i++) {
                    if (Admin.equals(admins.get(i).toString())) {
                        if (Password.equals(passwords.get(i).toString())) {
                            ok = true;
                            JOptionPane.showMessageDialog(null,
                                        "Welcome, u have successfully logged in");
                            Mainpage();
                            break;
                        else {
                            ok = false;
                    else {
                        ok = false;
                if (!ok) {
                    JOptionPane.showMessageDialog(null,
                                  "Incorrect Password or Admin No, Please Try Again",
                                  "Access Denied",
                                   JOptionPane.ERROR_MESSAGE);
            if(ev.getSource() == startBut)
                   Quiz1();
              if (ev.getSource () == next0) {
                   saveanswer();
                   Quiz2();
              if (ev.getSource () == next1) {
                   //saveanswer();
                   Quiz3();
              if (ev.getSource () == finishB) {
                   //saveanswer();
                   //checkanswer();
         /*class quizCanvas extends Canvas {
              private Image quest;
              public quizCanvas() {
                   this.quest = null;
              public quizCanvas(Image quest) {
                   this.quest = quest;
              public void insert(Image quest) {
                   this.quest=quest;
                   repaint();
              public void paint(Graphics g) {
         public void checkanswer() {
              if (!checked) {
              /*question = 0;
                   for (int a=1;a<16;a++) {
                        question++;*/
                        if (ansF1) {
                             if (answer[1].toUpperCase().equals(solution[1])) {
                                  correct++;
                        if (ansF2) {
                             if (answer[2].toUpperCase().equals(solution[2])) {
                                  correct++;
                        if (ansF3) {
                             if (answer[3].toUpperCase().equals(solution[3])) {
                                  correct++;
              checked = true;     }
         public void saveanswer() {
              if (text) {
                   if (!ansF1.getText().equals("")) {
                        answer [Quiz1] = ansF1.getText();
                   //answer2[question] = tf2.getText();
                   if (!ansF2.getText().equals("")) {
                        answer [] = ansF2.getText();
                   if (!ansF3.getText().equals("")) {
                        answer [] = ansF3.getText();
    }

  • I need help on this program..

    import java.util.*;
    public class D3
    private static int[] z = new int[100000];
    private static int first=z[0];
    private static int last=z[n-1];
    private static int n=100000;
    public static void main(String args[])
    Scanner input=new Scanner(System.in);
    for(int i=0;i<z.length;i++)
    z=2*i;
    int seqSearch(z;50000;n); //method call 4 key where key=mid
    int binSearch(z;first;last;50000);
    int seqSearch(z;35467;n); //method call 4 key where key in the left half
    int binSearch(z;first;last;35467);
    int seqSearch(z;89703;n); //method call 4 key where key in the right half
    int binSearch(z;first;last;89703);
    public int seqSearch(int z[];int key;int n)
    long start = System.currentTimeMillis();
    int count=0;
    int ans=-1;
    for(int i=0;i<n;i++)
    if z=key
    count++
    {ans=i
    break;}
    return ans;
    long elapsed = System.currentTimeMillis() - start;
    System.out.print("Execution Time:" + elapsed);
    System.out.print("# of Basic Operations:" + count);
    public int binSearch(int z[];int first;int last;int key)
    long start = System.currentTimeMillis();
    int count=0;
    if(last><first){
    count++;
    index=-1;
    else
    count++;
    int mid=(first+last)/2
    if(ket=z[mid]{
    index=mid;
    else
    if(key><z[mid]){
    index = binSearch(z[];first;mid-1;key);
    else
    index=binSearch(z[];mid+1;last;key);
    return index;
    long elapsed = System.currentTimeMillis() - start;
    System.out.print("Execution Time:" + elapsed);
    System.out.print("# of Basic Operations:" + count);
    if anyone could please tell me whats wrong with my code i'd be greatful...the program is supposed to perform binary and sequential search on a sorted array of 100000 numbers.once on an item in the middle of the array once on the right side of it and once on the left side...i also need to count the number of basic operations for the same number in both sequential and binary to see whats better.and i need to check the time...i think the method call is wrong,not sure though...plz i need help.its not compiling and i dont know why..

    Just add new messages to a thread you've already created. Don't create a new thread each time.
    Anyway, look. This is wrong:int seqSearch(z;50000;n); //method call 4 key where key=midfor two reasons. The first is that leading "int"; it doesn't mean anything here. "int" is used to declare an integer variable, but you're not declaring a variable here, you're invoking a method. The second problem is that you're using semicolons to separate arguments in the method call, but actually commas are correct. You probably want something more like this:
    int result;
    result = seqSearch(z, 50000, n);  //method call 4 key where key=mid.
    Some more problems with your code: you're calling non-static methods in a static context (the main method is static and seqSearch isn't). You're also using "n" before you declare it, which is probably a problem.
    And this makes no sense:z=2*i;because you've declared z to be an array; you can't use the multiplication operator on an array. It's not clear really what you're trying to accomplish there.
    Here's what I want you to do. Take your code and completely remove the binSearch method. Just rip it out. Then in your main() method, take out all references to the binSearch method, and all references except for the first one of the seqSearch method. Fix the things I mentioned above.
    Then try to compile what you have. It won't compile. You will get error messages. That's OK. Just fix them and move on. If you don't understand an error message, ask on these forums (DON'T CROSSPOST), quoting the full error message and the relevant lines of code.
    After a couple hours, you'll fix the syntactical bugs, and your program will compile. Then you'll find that it compiles but the program doesn't work right. That's also OK. This is how computer programming works. It's part of the process. Don't panic. At that point, you can start trying to fix the program so it does what it's supposed to. Eventually you'll get it to work.
    Then, and only then add more invocations of the seqSearch method. They won't all work, probably. You'll find more bugs. That's OK. Just repeat the process of fixing them.
    When you've fixed those bugs, then, and only then, add the binSearch method. Repeat the process of fixing syntax and hunting down and fixing bugs.
    Then your program will work.

  • Need help with inventory program!!! someone please help me!!!

    Ok I have to write this inventory program for one of my classes.
    For part one i needed to Create a product class that holds the item number, the name of product, the number of units in stock, and the price of each unit.
    Then create a java application that displays all of the above info plus the total value of the inventory. I have done this so far with success.
    For part two i needed to modify the program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a time including the item number, the name of the product, the number of units in stock, the price per unit, and the value of the inventory of that product. In addition, the output should display the value of the entire inventory.
    so create a method to calculate the value of the entire inventory.(i did this)
    and create another method to sort the array items by the name of the product. ( i did this)
    The program compiles and runs fine except it is not doing anything from part two. It just does the same thing that it did when i wrote part one.
    Does anyone know why or what i need to do to my code.
    Here is my code.
    import java.util.Scanner; // program uses class Scanner
    import java.util.Arrays;
    class ProductList
      Product[] products = new Product[100]; // an array of 100 pruducts
      private void populate() {
        products[0] = new Product(0, "Good Luck Chuck"      , 25, 4.95);
        products[1] = new Product(1, "The Bourne Identity"  ,  3, 7.95);
        products[2] = new Product(2, "The Reaping"          ,  5, 8.99);
          products[3] = new Product(3, "Deja Vu"              ,  2,12.99);
          products[4] = new Product(4, "I Know Who Killed Me" ,  3,10.95);
      private void sortByTitle() {
      private void print() {
        for(int i=0; i<products.length; i++) {
          System.out.println(products);
    private void printTotalInventoryValue() {
    System.out.println("Total Inventory Value = "+calculateTotalInventoryValue());
    private double calculateTotalInventoryValue() {
    double total = 0D;
    for(int i=0; i<products.length; i++) {
    total += products[i].calculateInventoryValue();
    return total;
    public static void main( String args[] ) {
    ProductList list = new ProductList();
    list.populate();
    list.sortByTitle();
    list.print();
    list.printTotalInventoryValue();
    } class Product
    private int id;
    private String title;
    private int stock;
    private double price;
    public Product(int id, String title, int stock, double price) {
    setId(id);
    setTitle(title);
    setStock(stock);
    setPrice(price);
    public int getId() { return this.id; }
    public void setId(int id) { this.id = id; }
    public String getTitle() { return this.title; }
    public void setTitle(String title) { this.title = title; }
    public int getStock() { return this.stock; }
    public void setStock(int stock) { this.stock = stock; }
    public double getPrice() { return this.price; }
    public void setPrice(double price) { this.price = price; }
    public double calculateInventoryValue() {
    return getStock() * getPrice();
    public class Inventorypt2
    private String ProductInfo; // call class product info
    public static void main(String args[])
    //create Scanner to obtain input from command window
    Scanner input = new Scanner( System.in );
    int num; // product's item number
    int stock; // number of items in stock
    double price; // price each of item
    ProductInfo product; // product information instance
    System.out.println(); // blank line
    String name = "go";
    // loop until sentinel value read from user
    while ( !name.equalsIgnoreCase ("stop") )
    System.out.print( "Enter DVD title, or STOP to quit: "); // prompt
    name = input.nextLine(); // read item name from user or quit
    System.out.print( "Enter the item number: "); // prompt
    num = input.nextInt(); // read item number from user
    while ( num <=0 ) //loop until item number is positive
    System.out.println ("Item number must be positive. Please re-enter item number: ");//prompt user to re-enter item number
    num = input.nextInt(); // read item number
    } //end while
    System.out.print( "Enter the quantity in stock: "); // prompt
    stock = input.nextInt(); // read stock quantity from user
    while ( stock <0 ) //loop until stock is positive
    System.out.println ("Quantity in stock can not be less than zero. Please re-enter the quantity in stock: ");//prompt user to re-enter quantity in stock
    stock = input.nextInt(); // read stock quantity from user
    } //end while
    System.out.print( "Enter the price of DVD: "); // prompt
    price = input.nextDouble(); // read item price from user
    while ( price <=0 ) //loop until price is positive
    System.out.println ("Product price must be positive. Please re-enter the price of the product: ");//prompt user to re-enter product price
    price = input.nextDouble(); // read item price from user
    } //end while
    product = new ProductInfo( num, name, stock, price); // initialize ProductInfo variables
    System.out.println(); // blank line
    System.out.printf( "Item Name: %S\n", product.getName());
    System.out.printf( "Item Number: %s\n", product.getNum());
    System.out.printf( "Qty. in Stock: %s\n", product.getStock());
    System.out.printf( "Price Each: $%.2f\n", product.getPrice());
    System.out.printf( "Total Value in Stock: $%.2f\n", product.getInventoryTotal());
    System.out.println(); // blank line
    System.out.print( "Enter DVD title, or STOP to quit: "); // prompt
    name = "";
    while ( name.equals("") )
    name = input.nextLine(); // read new product name from user or quit
    } //end while
    System.out.println(); // blank line
    System.out.println("Good Bye!"); // exit message
    Edited by: jay1981 on Mar 16, 2008 2:07 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    You will get more help if your code is formatted better:
    * Only post code that is already formatted correctly including indentations.
    * Get rid of all those comments cluttering up your code.
    * Make sure your posted code compiles without need for any changes. Yours doesn't at present. Where is the ProductInfo class?
    Again, you want it easy for a volunteer here to read your post, otherwise he/she simply won't do it. Good luck.

  • Need help in applet

    Hi all,
    I am newbie in java applet programming,
    I have write a source code that have 3 button in applet. (Booking, schedule and verify)
    I want to make when the user press the button it will call the other java class that contain the interface off booking Or Schedule Or Verify. I want the i nterface output add the center of parentPanel in mycode.
    I did not know how to write the other java file that can be call in my java class, can anyone help me to write the simple one?
    parentPanel.add(call other class that contain interface, BorderLayout.CENTER);
    Below is my code:
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.DecimalFormat;
    public class Kell extends JApplet {
        private JPanel parentPanel, titlePanel, orderPanel;
        private JPanel bottomPanel, titleAndMenuPanel;
          private JPanel menuBtnPanel;
        private JLabel lblTitle, lblDesc;
          private JButton bookingBtn, scheduleBtn, verifyBtn;
        private ButtonGroup menuUtamaBtn;
         // Applet Size
         private final Dimension appletSize = new Dimension(500, 500);
        public void init()
            // set applet size
            this.setSize(appletSize);
            * Create Panels
            parentPanel = new JPanel();
                orderPanel = new JPanel();
                titlePanel = new JPanel();
                titleAndMenuPanel = new JPanel();
                menuBtnPanel = new JPanel();
            bottomPanel = new JPanel();
            * Set Panel Layouts
                titleAndMenuPanel.setLayout(new GridLayout(2,1));
            parentPanel.setLayout(new BorderLayout());
            titlePanel.setLayout(new BoxLayout(titlePanel, BoxLayout.Y_AXIS));
            orderPanel.setLayout(new BoxLayout(orderPanel, BoxLayout.Y_AXIS));
                menuBtnPanel.setLayout(new GridLayout(1,3));
            //bottomPanel.setLayout(new BorderLayout(5,5));
            // Title
            lblTitle = new JLabel("Bookiing OnnnLiine");
            lblTitle.setFont (new Font ("Book Antiqua", Font.BOLD, 18));
            lblTitle.setAlignmentX(Component.CENTER_ALIGNMENT);
            titlePanel.add(lblTitle);
            lblDesc = new JLabel("This is the online system that....");
            lblDesc.setFont (new Font ("Book Antiqua", Font.BOLD, 18));
            lblDesc.setAlignmentX(Component.CENTER_ALIGNMENT);
            orderPanel.add(lblDesc);
               // Button
                menuUtamaBtn = new ButtonGroup();
            bookingBtn = new JButton("Booking");
            scheduleBtn = new JButton("Schedule");
            verifyBtn = new JButton("Verify");
                menuUtamaBtn.add(bookingBtn);
            menuUtamaBtn.add(scheduleBtn);
            menuUtamaBtn.add(verifyBtn);
          //bookingBtn.addActionListener(new bookingBtnListener());
          //scheduleBtn.addActionListener(new scheduleBtnListener());
          //verifyBtn.addActionListener(new verifyBtnListener());
            menuBtnPanel.add(bookingBtn);
            menuBtnPanel.add(scheduleBtn);
            menuBtnPanel.add(verifyBtn);
             * Add Panels
                titleAndMenuPanel.add(titlePanel, BorderLayout.NORTH);
                titleAndMenuPanel.add(menuBtnPanel, BorderLayout.SOUTH);
            parentPanel.add(titleAndMenuPanel, BorderLayout.NORTH);
            parentPanel.add(orderPanel, BorderLayout.CENTER);
            parentPanel.add(bottomPanel, BorderLayout.SOUTH);
            add(parentPanel);
         * Listeners
          private class bookingBtnListener implements ActionListener {
            public void actionPerformed (ActionEvent event) {
                   // I want it to call the other class
    }thanks

    I have two java file.
    The main java file is Kell.java
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.DecimalFormat;
    public class Kell extends JApplet {
        private JPanel parentPanel, titlePanel, orderPanel;
        private JPanel bottomPanel, titleAndMenuPanel;
          private JPanel menuBtnPanel;
        private JLabel lblTitle, lblDesc;
          private JButton bookingBtn, scheduleBtn, verifyBtn;
        private ButtonGroup menuUtamaBtn;
         // Applet Size
         private final Dimension appletSize = new Dimension(500, 500);
        public void init()
            // set applet size
            this.setSize(appletSize);
            * Create Panels
            parentPanel = new JPanel();
                orderPanel = new JPanel();
                titlePanel = new JPanel();
                titleAndMenuPanel = new JPanel();
                menuBtnPanel = new JPanel();
            bottomPanel = new JPanel();
            * Set Panel Layouts
                titleAndMenuPanel.setLayout(new GridLayout(2,1));
            parentPanel.setLayout(new BorderLayout());
            titlePanel.setLayout(new BoxLayout(titlePanel, BoxLayout.Y_AXIS));
            orderPanel.setLayout(new BoxLayout(orderPanel, BoxLayout.Y_AXIS));
                menuBtnPanel.setLayout(new GridLayout(1,3));
            //bottomPanel.setLayout(new BorderLayout(5,5));
            // Title
            lblTitle = new JLabel("Bookiing OnnnLiine");
            lblTitle.setFont (new Font ("Book Antiqua", Font.BOLD, 18));
            lblTitle.setAlignmentX(Component.CENTER_ALIGNMENT);
            titlePanel.add(lblTitle);
            lblDesc = new JLabel("This is the online system that....");
            lblDesc.setFont (new Font ("Book Antiqua", Font.BOLD, 18));
            lblDesc.setAlignmentX(Component.CENTER_ALIGNMENT);
            orderPanel.add(lblDesc);
               // Button
                menuUtamaBtn = new ButtonGroup();
            bookingBtn = new JButton("Booking");
            scheduleBtn = new JButton("Schedule");
            verifyBtn = new JButton("Verify");
                menuUtamaBtn.add(bookingBtn);
            menuUtamaBtn.add(scheduleBtn);
            menuUtamaBtn.add(verifyBtn);
            bookingBtn.addActionListener(new bookingBtnListener());
          //scheduleBtn.addActionListener(new scheduleBtnListener());
          //verifyBtn.addActionListener(new verifyBtnListener());
            menuBtnPanel.add(bookingBtn);
            menuBtnPanel.add(scheduleBtn);
            menuBtnPanel.add(verifyBtn);
             * Add Panels
                titleAndMenuPanel.add(titlePanel, BorderLayout.NORTH);
                titleAndMenuPanel.add(menuBtnPanel, BorderLayout.SOUTH);
            parentPanel.add(titleAndMenuPanel, BorderLayout.NORTH);
            parentPanel.add(orderPanel, BorderLayout.CENTER);
            parentPanel.add(bottomPanel, BorderLayout.SOUTH);
            add(parentPanel);
         * Listeners
          private class bookingBtnListener implements ActionListener {
            public void actionPerformed (ActionEvent event) {
                   // I want it to call the other class
                   MyFrame booking = new MyFrame();
                   parentPanel.add(booking.bookingPANEL(), BorderLayout.CENTER);
    }The other file is MyFrame.java:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MyFrame
         public JPanel bookingPANEL()
              JPanel bookingP = new JPanel();
              bookingP.setLayout(new BoxLayout(bookingP, BoxLayout.Y_AXIS));
              JLabel lblDesc = new JLabel("Testing Booking Panel");
              lblDesc.setFont (new Font ("Book Antiqua", Font.BOLD, 18));
              lblDesc.setAlignmentX(Component.CENTER_ALIGNMENT);
              bookingP.add(lblDesc);
              return bookingP;
    }How i want to call the MyFrame.java when i click at the Booking button on the Kell.java. I want the JPanel in the MyFrame.java display in
    parentPanel.add(booking.bookingPANEL, BorderLayout.CENTER);Can you help me?
    null

  • Need help writing Labview Program!!!!!

    I have a labview project that needs to be finished. I was not the original creator of the program and the guy who created no longer is involved with the project and I am left to finish it. Could you make the final adjustment so I can turn this into my professor and get the final grade. Thanks! Willing to pay! Negeotiable price!!!!!!!!

    Need help completing assignment! Could anyone assist me in this project!
    Attachments:
    dial tone detection.zip ‏1253 KB

  • Need help writing small program!

    Hi. I'm learning Java programming, and I need help writing a small program. Please someone help me.
    Directions:
    Create a program called CerealCompare using an if-then-else structure that obtains the price and number of ounces in a box for two boxes of cereal. The program should then output which box costs less per ounce.

    class CerealCompare {
        public static void main(String[] args) {
            // your code goes here
    }Hope that helps.
    P.S. Java does not have an if-then-else statement.

  • Need help with Applet: Images

    DUKESTARS HERE, YOU KNOW YOU WANNA
    Hi,
    I'm designing an applet for some extra credit and I need help.
    This game that i have designed is called "Digit Place Game", but there is no need for me to explain the rules.
    The problem is with images.
    When I start the game using 'appletviewer', it goes to the main menu:
    http://img243.imageshack.us/img243/946/menuhy0.png
    Which is all good.
    But I decided that when you hover your cursor over one of the options such as: Two-Digits or Three-Digits, that the words that are hovered on turn green.
    http://img131.imageshack.us/img131/6231/select1ch3.png
    So i use the mouseMoved(MouseEvent e) from awt.event;
    The problem is that when i move the mouse around the applet has thick line blotches of gray/silver demonstrated below (note: these are not exact because my print screen doesn't take a picture of the blotches)
    http://img395.imageshack.us/img395/4974/annoyingmt1.png
    It also lags a little bit.
    I have 4 images in my image folder that's in the folder of the source code
    The first one has all text blue. The second one has the first option, Two-Digits green but rest blue. The third one has the second option, Three-Digits green but rest blue, etc.
    this is my code
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.awt.event.*;
    import java.awt.*;
    public class DigitPlaceGame extends Applet implements MouseListener, MouseMotionListener {
         public boolean load = false;
         public boolean showStartUp = false;
         public boolean[] hoverButton = new boolean[3];
         Image load1;
         Image showStartUp1;
         Image showStartUp2;
         Image showStartUp3;
         Image showStartUp4;
         public void init() {
              load = true;
              this.resize(501, 501);
                   try {
                        load1 = getImage(getCodeBase(), "images/load1.gif");
                        repaint();
                   } catch (Exception e) {}
              load();
         public void start() {
         public void stop() {
         public void destroy() {
         public void paint(Graphics g) {
              if(load == true) {
                   g.drawImage(load1, 0, 0, null, this);
              } else if(showStartUp == true) {
                   if(hoverButton[0] == true) {
                        g.drawImage(showStartUp2, 0, 0, null, this);
                   } else if(hoverButton[1] == true) {
                        g.drawImage(showStartUp3, 0, 0, null, this);
                   } else if(hoverButton[2] == true) {
                        g.drawImage(showStartUp4, 0, 0, null, this);
                   } else {
                        g.drawImage(showStartUp1, 0, 0, null, this);
                        for(int i = 0; i < 3; i++) {
                             hoverButton[i] = false;
         public void load() {
              addMouseListener(this);
              addMouseMotionListener(this);
              showStartUp1 = getImage(getCodeBase(), "images/showStartUp1.gif");
              showStartUp2 = getImage(getCodeBase(), "images/showStartUp2.gif");
              showStartUp3 = getImage(getCodeBase(), "images/showStartUp3.gif");
              showStartUp4 = getImage(getCodeBase(), "images/showStartUp4.gif");
              showStartUp();
         public void showStartUp() {
              load = false;
              showStartUp = true;
         public void mouseClicked(MouseEvent e) {
              System.out.println("test");
         public void mouseMoved(MouseEvent e) {
              int x = e.getX();
              int y = e.getY();
              if(x >= 175 && x <= 330 && y >= 200 && y <= 235) {
                   hoverButton[0] = true;
                   repaint();
              } else if(x >= 175 && x <= 330 && y >= 250 && y <= 280) {
                   hoverButton[1] = true;
                   repaint();
              } else if(x >= 175 && x <= 330 && y >= 305 && y <= 335) {
                   hoverButton[2] = true;
                   repaint();
              } else {
                        for(int i = 0; i < 3; i++) {
                             hoverButton[i] = false;
                        repaint();
         public void mouseEntered(MouseEvent e) {
         public void mouseExited(MouseEvent e) {
         public void mousePressed(MouseEvent e) {
         public void mouseReleased(MouseEvent e) {
         public void mouseDragged(MouseEvent e) {
    }plox help me ploz, i need the extra credit for an A
    can you help me demolish the lag and stop the screen from flickering? thanks!!!!!
    BTW THIS IS EXTRA CREDIT NOT HOMework
    DUKESTARS HERE, YOU KNOW YOU WANNA
    Edited by: snoy on Nov 7, 2008 10:51 PM
    Edited by: snoy on Nov 7, 2008 10:53 PM

    Oh yes, I knew there could be some problem.......
    Now try this:
    boolean a,b,c;
    if((a=(x >= 175 && x <= 330 && y >= 200 && y <= 235)) && !hoverButton[0]) {
                   hoverButton[0] = true;
                   repaint();
              } else if((b=(x >= 175 && x <= 330 && y >= 250 && y <= 280)) && !hoverButton[1]) {
                   hoverButton[1] = true;
                   repaint();
              } else if((c=(x >= 175 && x <= 330 && y >= 305 && y <= 335)) && !hoverButton[2]) {
                   hoverButton[2] = true;
                   repaint();
              } else if ((!a && !b && !c)&&(hoverButton[0] || hoverButton[1] || hoverButton[2]){
                        for(int i = 0; i < 3; i++) {
                             hoverButton[i] = false;
                        repaint();
              }hope it works........
    Edited by: T.B.M on Nov 8, 2008 10:41 PM

  • Need help in pda programming

    Hi, I am new on pda programming. I already develop a java program using j2sdk1.4.2_05. I need to run this program in pda for my final project. Can i do this using creme? What version do i must use?
    If j2sdk1.4.2_05 can't, does jdk1.3.1 can?
    And anybody know where can i find pocket pc emulator so i can test my program on pc?
    Many Thanks before,
    tinna

    hi,
    I am currently doing a project in pda application. We are using jeode as a VM for the pda. But it uses java 1.2. Maybe you want to have a look at it. however u cant use the swing class in jeode and only awt is the class availlable for programming interfaces.
    If you need jeode u can contact me. I can give you a free copy which was availlable till last year as now it has gone chargable.
    Also do you have any idea about how can i read and write txt files or dat files from desktop using java. I want to use a usb cradle for connection.
    This information would be really appreciated as I need this for my second year project.

  • I need help in some programs

    i'm new in a jave and i need to write some programs
    1) write a program that allows the user to enter a range of number. for that range of number, list the numbers and state their properties:
    prime or not rrime; deficient, perfect, or abundant; smith number or not.
    2) write a program that finds the largest Smith number possible that can be held in Java integer

    BigDaddyLoveHandles wrote:
    Psyber wrote:
    Here's the algorithm for perfect numbers:
    boolean p_num(int number) {
    int sum = 1;
    for (int n = 2; n <= number / 2; n++)
    if (number % n == 0)
    sum += n;
    return sum == number ? true : false;
    }Now hand over the dukes.Why not:
    return sum == number;
    Whaddya expect for 10 dukes?

  • Need help for java program

    Hi,
    I need help with my web application. When i tried to run it using
    localhost:8080
    it's giving me error that
    signup.do file is not available.
    can someone tell me what could be wrong with my code?
    I want to know what is .do file and what needs to do to have remove the error
    I have also used struts config file.
    Please help me.
    Message was edited by:
    star4588

    See struts documentation here http://struts.apache.org/1.2.9/userGuide/building_controller.html#action_mapping_example
    you should have something like that :
    <action-mappings>
            <action
                path="/signup"
                type="org.apache.struts.webapp.example.SignupAction"
                name="signupForm"
                scope="request"
                input="/signup.jsp"
                unknown="false"
                validate="true" />
        </action-mappings>in your struts-config.xml.
    Hope That Helps

  • Need Help With Shell Programming

    Hi, I need some guidance as to how to approach my project.
    I need to develop a shell to host an e-learning environment that can be accessed through the internet. The user, preferably, needs not to download anything to run/start the e-learning environment. This e-learning environment allows users/students to create a forum, create a chatroom, hand up projects, send mail, do surveys and tutorials online and these can be submitted to the teacher/marker and receive feedback and also view their grades and schedule. Eg, Blackboard http://www.blackboard.com/
    The problem is is that there seems to be no shell programming by using java. I have found only shell programming using UNIX, korn and C. I read other posts in the forums here concerning shell programming and alot of the codes include the first 2 lines :
    Runtime rt = Runtime.getRuntime();      
    String command = "your_shell_script_command";      
    try {           
          Process process = rt.exec(command);           
         from = new BufferedReader(new InputStreamReader(process.getInputStream()));           
         to = new PrintWriter(process.getOutputStream(), true);      
    catch (IOException e) {         ...       }the above codes were taken from this post: http://forum.java.sun.com/thread.jsp?forum=57&thread=352231
    Does it means that I need to use another language besides Java to program a shell and then run it together with my java program? If so, what language do I need to learn and what Java "component" do I need to use? and is it possible to run a shell in an applet, since the applet is viewable through a browser?
    I really need some help on this problem as I don't have a clue to go about it at all. Thanks in advance.

    er, actually the applet does not seem to load at all.
    But from what you have written, yeah, I need to
    process the user's input and in my case, his
    selected/choosen options in a menu.
    E.g, the user wants to create a forum, he/she chooses
    the create forum option from the menu which is part of
    the shell and something happens which allows the user
    to customise the forum.
    So, let me get this straight, I can create an applet
    and run the shell on the applet and the user can view
    this application without downloading anything? As YAT said...providing they have the java plugin...yes... if you keep it to java.applet.Applet (AWT) and not JApplet, you should even have more users able to run it without 'downloading' anything..
    Now..to be clear... they ARE downloading your .class files, and running them within a JVM on their own local machine... But they will not need anything (assuming their browser supports the Java version you write in) else...

  • Need help with applet related problems

    First of all hello to everyone. I'm new to this forum. I usually can solve my problems google-ing around, but this time I just ran out of ideas.
    I'm trying to develop a jni applet that can run native code for performance. I used netbeans so far and the applet works great when run from within the ide. At some point a managed to make the applet run inside firefox and iexplore, however somehow i screwed something up and now i can't make it run anymore. I don't really know what i did but i think it may be related to these lines in the console since everything up until awt works fine in the applet:
    basic: JNLP2ClassLoader.findLibrary: Looking up native library: jawt.dll
    network: Looking up native library in: C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-n\jawt.dll
    basic: Native library jawt.dll not found
    Ofc i may be wrong.
    This also my be a local problem because a friend of mine tried the applet himself and said it's working.
    All the jars are selfsigned.
    below i posted the console output in case you want to take a look. Also I am interested about the "try again.." messages that seem to pop over and over again.
    Java Plug-in 1.6.0_27
    Using JRE version 1.6.0_27-b07 Java HotSpot(TM) Client VM
    User home directory = C:\Users\Gladiator
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition value null
    security: property package.definition new value com.sun.javaws
    security: property package.definition value com.sun.javaws
    security: property package.definition new value com.sun.javaws,com.sun.deploy
    security: property package.definition value com.sun.javaws,com.sun.deploy
    security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    network: Created version ID: 1.6.0.27
    network: Created version ID: 1.6
    network: Created version ID: 1.6.0.27
    network: Created version ID: 1.6
    network: Created version ID: 1.6.0.27
    network: Created version ID: 1.6
    network: Created version ID: 1.6.0.27
    network: Created version ID: 1.6
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp, version: null]
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp, version: null]
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp, version: null]
    network: ResponseCode for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp : 200
    network: Encoding for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp : null
    network: Sever response: (length: 564, lastModified: Wed Sep 07 16:30:17 EEST 2011, downloadVersion: null, mimeType: application/x-java-jnlp-file)
    network: Downloading resource: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp
         Content-Length: 564
         Content-Encoding: null
    network: Wrote URL file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp to File C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\57\7465fe39-7a36cd96-temp
    network: Cache: Enable a new CacheEntry: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp
    temp: new XMLParser with source:
    temp: <?xml version="1.0" encoding="UTF-8"?>
    <jnlp href="launch.jnlp">
    <information>
    <title>test app</title>
    <vendor>Raven</vendor>
    </information>
    <resources>
    <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" />
    <jar href="SpaceGame.jar" main="true" />
    </resources>
    <resources os="Windows">
    <nativelib href="lib/swt.jar"/>
    </resources>
    <applet-desc
    name="test app"
    main-class="javatest.JTest"
    width="800"
    height="600">
    </applet-desc>
    <security>
    <all-permissions/>
    </security>
    </jnlp>
    temp:
    returning ROOT as follows:
    <jnlp href="launch.jnlp">
    <information>
    <title>test app</title>
    <vendor>Raven</vendor>
    </information>
    <resources>
    <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
    <jar href="SpaceGame.jar" main="true"/>
    </resources>
    <resources os="Windows">
    <nativelib href="lib/swt.jar"/>
    </resources>
    <applet-desc name="test app" main-class="javatest.JTest" width="800" height="600"/>
    <security>
    <all-permissions/>
    </security>
    </jnlp>
    temp: returning LaunchDesc from XMLFormat.parse():
    <jnlp spec="1.0+" codebase="file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/" href="file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp">
    <information>
    <title>test app</title>
    <vendor>Raven</vendor>
    <homepage href="null"/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <update check="timeout" policy="always"/>
    <resources>
    <java href="http://java.sun.com/products/autodl/j2se" version="1.6+"/>
    <jar href="file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar" download="eager" main="true"/>
    <nativelib href="file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar" download="eager" main="false"/>
    </resources>
    <applet-desc name="test app" main-class="javatest.JTest" documentbase="file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.html" width="800" height="600"/>
    </jnlp>
    network: CleanupThread used 16572 us
    basic: Plugin2ClassLoader.addURL2 called for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
    basic: Plugin2ClassLoader.addURL2 called for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
    basic: Plugin2ClassLoader.drainPendingURLs addURL called for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
    basic: Plugin2ClassLoader.drainPendingURLs addURL called for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
    network: No Custom Progress jar
    network: LaunchDownload: concurrent downloads from LD: 4
    network: Total size to download: -1
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar, version: null]
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar, version: null]
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar, version: null]
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar, version: null]
    network: ResponseCode for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar : 200
    network: ResponseCode for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar : 200
    network: Encoding for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar : null
    network: Encoding for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar : null
    network: Sever response: (length: 12948, lastModified: Tue Sep 06 22:46:50 EEST 2011, downloadVersion: null, mimeType: application/x-java-archive)
    network: Sever response: (length: 2007707, lastModified: Tue Sep 06 22:47:10 EEST 2011, downloadVersion: null, mimeType: application/x-java-archive)
    network: CleanupThread used 1 us
    network: Downloading resource: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
         Content-Length: 12,948
         Content-Encoding: null
    network: Downloading resource: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
         Content-Length: 2,007,707
         Content-Encoding: null
    network: Wrote URL file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar to File C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\5\26fb4185-10c9079c-temp
    network: Validating file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar , version null...
    security: Blacklist revocation check is enabled
    security: Trusted libraries list check is enabled
    network: Cache: Enable a new CacheEntry: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
    network: CleanupThread used 1 us
    network: Downloaded file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar: file:/C:/Users/Gladiator/AppData/LocalLow/Sun/Java/Deployment/cache/6.0/5/26fb4185-10c9079c
    network: Download Progress: jarsDone: 1
    network: Wrote URL file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar to File C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-temp
    network: Validating file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar , version null...
    network: Cache: Enable a new CacheEntry: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
    network: CleanupThread used 2 us
    network: Downloaded file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar: file:/C:/Users/Gladiator/AppData/LocalLow/Sun/Java/Deployment/cache/6.0/10/1082924a-7851bf5e
    network: Download Progress: jarsDone: 2
    network: Created version ID: 1.6+
    network: Created version ID: 1.6.0.27
    network: Created version ID: 1.6.0.27
    network: Created version ID: 1.6
    basic: LaunchDesc location: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp
    network: Created version ID: 1.0+
    network: Created version ID: 6.0.18
    security: Validating signatures for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp
    security: TustedSet null
    security: Empty trusted set for [file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp]
    security: Round 1 (0 out of 2):file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
    security: Entry [file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar] is not prevalidated. Revert to full validation of this JAR.
    security: Round 2 (0 out of 2):file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
    security: Validating cached jar url=file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar ffile=C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\5\26fb4185-10c9079c com.sun.deploy.cache.CachedJarFile@698403
    security: Round 2 (1 out of 2):file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
    security: Validating cached jar url=file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar ffile=C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e com.sun.deploy.cache.CachedJarFile@e80842
    security: Have 1 common certificates after processing file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
    security: Istrusted: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp false
    security: Accessing keys and certificate in Mozilla user profile: null
    security: Loading Root CA certificates from C:\Program Files (x86)\Java\jre6\lib\security\cacerts
    security: Loaded Root CA certificates from C:\Program Files (x86)\Java\jre6\lib\security\cacerts
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA hasnt been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    security: User has granted the priviledges to the code for this session only
    security: Adding certificate in Deployment session certificate store
    security: Added certificate in Deployment session certificate store
    security: Saving certificates in Deployment session certificate store
    security: Saved certificates in Deployment session certificate store
    security: Mark trusted: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp
    basic: LD - All JAR files signed: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp
    basic: passing security checks; secureArgs:true, allSigned:false
    basic: continuing launch in this VM
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA hasnt been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    basic: JNLP2ClassLoader.findClass: javatest.JTest: try again ..
    basic: JNLP2ClassLoader.getPermissions() ..
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA hasnt been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    basic: Plugin2ClassLoader.getPermissions CeilingPolicy allPerms
    security: JAVAWS AppPolicy Permission requested for: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
    basic: JNLP2ClassLoader.getPermissions() X
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA hasnt been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.events.PaintListener: try again ..
    basic: JNLP2ClassLoader.getPermissions() ..
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA hasnt been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    basic: Plugin2ClassLoader.getPermissions CeilingPolicy allPerms
    security: JAVAWS AppPolicy Permission requested for: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
    basic: JNLP2ClassLoader.getPermissions() X
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.SWTEventListener: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Drawable: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Layout: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.layout.FillLayout: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Composite: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Scrollable: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Control: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Widget: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Shell: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Decorations: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Canvas: try again ..
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA hasnt been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    basic: Applet loaded.
    basic: Applet resized and added to parent container
    basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 81605 us, pluginInit dt 2397573 us, TotalTime: 2479178 us
    basic: JNLP2ClassLoader.findClass: javatest.JTest$1: try again ..
    basic: Applet initialized
    C:\Users\Gladiator\AppData\Roaming
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Display: try again ..
    basic: Removed progress listener: null
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Device: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.TEXTMETRICW: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.TEXTMETRIC: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.TEXTMETRICA: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.LOGFONTW: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.LOGFONT: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.LOGFONTA: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NONCLIENTMETRICSW: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NONCLIENTMETRICS: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NONCLIENTMETRICSA: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Event: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OS: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.C: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.Platform: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OSVERSIONINFO: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OSVERSIONINFOW: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OSVERSIONINFOA: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OSVERSIONINFOEXW: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OSVERSIONINFOEX: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OSVERSIONINFOEXA: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.Lock: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.Library: try again ..
    basic: JNLP2ClassLoader.findLibrary: Looking up native library: swt-win32-3735.dll
    network: Looking up native library in: C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-n\swt-win32-3735.dll
    basic: JNLP2ClassLoader.findLibrary: native library found: C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-n\swt-win32-3735.dll
    basic: Applet made visible
    basic: Starting applet
    basic: completed perf rollup
    basic: Applet started
    basic: Told clients applet is started
    basic: JNLP2ClassLoader.findLibrary: Looking up native library: swt-win32-3735.dll
    basic: JNLP2ClassLoader.findLibrary: native library found: C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-n\swt-win32-3735.dll
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.TCHAR: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.ACTCTX: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.DLLVERSIONINFO: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.STARTUPINFO: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Display$1: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Font: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Resource: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.Callback: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.WNDCLASS: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.TaskBar: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Listener: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.PAINTSTRUCT: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.GCData: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.GC: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.PROPERTYKEY: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.HIGHCONTRAST: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.MSG: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Synchronizer: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.SWT: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.SWTError: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.SWTException: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Cursor: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NMHDR: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NMLVDISPINFO: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.awt.SWT_AWT: try again ..
    basic: JNLP2ClassLoader.findLibrary: Looking up native library: jawt.dll
    network: Looking up native library in: C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-n\jawt.dll
    basic: Native library jawt.dll not found
    basic: JNLP2ClassLoader.findLibrary: Looking up native library: swt-awt-win32-3735.dll
    basic: JNLP2ClassLoader.findLibrary: native library found: C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-n\swt-awt-win32-3735.dll
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.MenuItem: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Item: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Menu: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NMTTDISPINFOA: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NMTTDISPINFO: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NMTTDISPINFOW: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.ToolTip: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.awt.SWT_AWT$11: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.awt.SWT_AWT$13: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.EventTable: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.WINDOWPOS: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.LRESULT: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.RECT: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Point: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.SerializableCompatibility: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Rectangle: try again ..
    basic: JNLP2ClassLoader.findClass: javatest.JTest$3: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.TypedListener: try again ..
    -----

    I am sorry for bold, i came here to ask for help. I used bold to differentiate output from my questions since i couldn't find tags.
    I already validated jnlp using JaNeLA and got only optimization suggestions.
    As I said in first post, this works for a friend of mine, so it's possible a local issue with my java or something ...
    Also i reinstalled jre/jdk 7.0, then uninstalled and installed latest jre/jdk 6.
    Hope I didn't leave a bad impression, i just want help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for