Querry regarding applets and application

hello sir,
i am in great trouble! please help me! see i want to know that is it possible that i can create an applet from application! in the sense i am studying in a computer institue and we are told to make a project on notepad! we are told to make a project through java! i have prepared it! but the question in my mind is that i have also created an applet which shows a clock with date and time! but the notepad i have created is an application and in that i have added menu bars in which there is a sub menu called "date/ time". i want that when ever some one clicks on date/ time tab then it should show the clock! i am confused! i cant get any thing as solution please help me! i am in great trouble! i want to submit my notepad by this thursday 2nd aug! please help me! i cant get anyone to help!
i am also mailing my whole code! please rectify if any present!
here is the code: for notepad
import java.awt.*;
import java.applet.*;
import java.awt.font.*;
import javax.swing.event.*;
import javax.swing.colorchooser.*;
import java.awt.print.*;
import java.awt.event.*;
import javax.swing.text.*;
import javax.swing.undo.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
public class Notepad implements KeyListener,ActionListener, ItemListener, Runnable
     static JFrame frame;
     static JTextArea txtArea;
     JScrollPane scrollPane;
     JMenuBar menuBar;
     JMenu fileMenu, editMenu, toolsMenu, aboutMenu;
     JMenuItem mNew, popNew, mDelete, mOpen, mSave, mSaveAs, mPrint, mClose, mExit, mCut, popCut, mCopy, popCopy, mPaste, popPaste,popSelectAll, mSelectAll, mDateTime, mAboutNotepad;
     JPanel panel;
     JPopupMenu popMenu;
     JCheckBoxMenuItem chkWordwrap;
     JComboBox cmbFontSize, cmbFont ;
     JToolBar toolbar;
     JButton btnSave, btnNew, btnOpen, btnCut, btnCopy, btnPaste;
     static boolean textChanged = false;
     static String title = " Notepad - by Vicky Saini";
     private static Vector fonts;
     static GraphicsEnvironment env;
     String fontChoice = "Font Choice";
     Integer FontSize ;
     Hashtable actions;
     DefaultStyledDocument document;
     Thread threadTime;
// static AudioClip clockbeep;     
public void help()
          JFrame frame= new JFrame();
          JOptionPane op = new JOptionPane(" Vicky Saini's NotePad 1.0, "
                                                            + "\n" + "Created by V I C K Y S A I N I \n"
                                                            + "Batch No: 1103 - SMA007 \n"
                                                            + "Developed under Guidence of Ashish Thakkar \n" + "\n" + "For support information Contact:\n"
                                                            +"[email protected] \n" + "\n"
+ " Copyright 2001-2005 SainiSoft\n"
                                                                 + "Download Version" + " \n"
                                                                 + "All Right Reserved \n" ,
JOptionPane.INFORMATION_MESSAGE,JOptionPane.CLOSED_OPTION,new ImageIcon("vickyN.jpg"));
               JDialog dialog = op.createDialog(frame,"About This Notepad");
               dialog.setSize(450,350);
               dialog.setResizable(false);
               dialog.show();          
     public static void main(String args[])
          //clockbeep=getAudioClip(getDocumentBase(),"clockbell.au");     
          //clockbeep.play();
          JOptionPane.showMessageDialog(new JFrame(),"Wel-Come to Vicky's Notepad");
          Notepad notepad = new Notepad();
          notepad.createNotepad();
          txtArea.setRequestFocusEnabled(true);
          txtArea.requestFocus();
          //clockbeep.stop();
     public void createNotepad()
          frame = new JFrame(title);
          frame.setSize(600, 550);
          document = new DefaultStyledDocument();
          txtArea = new JTextArea(document);
          createActionTable(txtArea);
          txtArea.addKeyListener(this);
          scrollPane = new JScrollPane(txtArea);
          menuBar = new JMenuBar();
          frame.setJMenuBar(menuBar);
          createMenu(menuBar);
          panel = new JPanel();
          panel.setLayout(new BorderLayout());
          toolbar = new JToolBar();
          addButton(toolbar);
          panel.add(toolbar, BorderLayout.NORTH);
          frame.addWindowListener(new AppCloser());
          popMenu = new JPopupMenu();
          popMenu.setVisible(true);
          popMenu.setInvoker(scrollPane);
          addpopMenuItem(popMenu);
          MouseListener popupListener = new PopupListener();
          txtArea.addMouseListener(popupListener);
          scrollPane.addMouseListener(popupListener);
          threadTime = new Thread();
          threadTime.start();
          txtArea.setCursor(Cursor.getDefaultCursor());
          try
               UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          catch(Exception exc)
               System.err.println("Error loading L&F: " + exc);
          panel.add(scrollPane, BorderLayout.CENTER);          
          frame.getContentPane().add(panel);
          frame.setVisible(true);     
     public String currentTime()
          Date currentDate = new Date();
          GregorianCalendar gc = new GregorianCalendar();
          gc.setTime(currentDate);
          String year = " " + gc.get(Calendar.YEAR);
          String month = year + "/" + gc.get(Calendar.MONTH);
          String day = month + "/" + gc.get(Calendar.DATE);
          String hour = day + " " + gc.get(Calendar.HOUR);
          String min = hour + ":" + gc.get(Calendar.MINUTE);
          String sec = min + ":" + gc.get(Calendar.SECOND);
          String milli = sec + "." + gc.get(Calendar.MILLISECOND);
          return milli;
     public void run()
          try
               for(;;)
                    threadTime.sleep(1);
                    currentTime();
          catch(Exception e)
     public void addpopMenuItem(JPopupMenu popMenu)
          popNew = new JMenuItem(" New ");
          popMenu.add(popNew);
          popNew.addActionListener(this);
          popMenu.addSeparator();
          popCut = new JMenuItem(" Cut ");
          popMenu.add(popCut);
          popCut.addActionListener(this);
          popCopy = new JMenuItem(" Copy ");
          popMenu.add(popCopy);
          popCopy.addActionListener(this);
          popPaste = new JMenuItem(" Paste ");
          popMenu.add(popPaste);
          popPaste.addActionListener(this);
          popMenu.addSeparator();
          popSelectAll = new JMenuItem(" Select All ");
          popMenu.add(popSelectAll);
          popSelectAll.addActionListener(this);     
     public void createMenu(JMenuBar menuBar)
          fileMenu = new JMenu(" File ");
          fileMenu.setMnemonic('F');
          menuBar.add(fileMenu);
          editMenu = new JMenu(" Edit ");
          editMenu.setMnemonic('E');
          menuBar.add(editMenu);
          toolsMenu = new JMenu(" Tools ");
          toolsMenu.setMnemonic('T');
          menuBar.add(toolsMenu);
          aboutMenu = new JMenu(" About ");
          aboutMenu.setMnemonic('A');
          menuBar.add(aboutMenu);
          mNew = new JMenuItem(" New ");
          fileMenu.add(mNew);
          mNew.addActionListener(this);
          mNew.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_MASK));
          mOpen = new JMenuItem(" Open ");
          fileMenu.add(mOpen);
          mOpen.addActionListener(this);
          mOpen.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_MASK));
          mClose = new JMenuItem(" Close ");
          fileMenu.add(mClose);
          mClose.addActionListener(this);
          fileMenu.addSeparator();
          mSave = new JMenuItem(" Save ");
          fileMenu.add(mSave);
          mSave.addActionListener(this);
          mSave.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.CTRL_MASK));
          mSaveAs = new JMenuItem(" SaveAs ");
          fileMenu.add(mSaveAs);
          mSaveAs.addActionListener(this);
          fileMenu.addSeparator();
          mPrint = new JMenuItem(" Print.... ");
          fileMenu.add(mPrint);
          mPrint.addActionListener(this);
          mPrint.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_MASK));
          mExit = new JMenuItem(" Exit ");
          fileMenu.add(mExit);
          mExit.addActionListener(this);
          mExit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.ALT_MASK));
          editMenu.addSeparator();
          mCut = new JMenuItem(" Cut ");
          editMenu.add(mCut);
          mCut.addActionListener(this);
          mCut.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK));
          mCopy = new JMenuItem(" Copy ");
          editMenu.add(mCopy);
          mCopy.addActionListener(this);
          mCopy.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_MASK));
          mPaste = new JMenuItem(" Paste ");
          editMenu.add(mPaste);
          mPaste.addActionListener(this);
          mPaste.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_MASK));          
          mDelete = new JMenuItem(" Delete ");
          mDelete.addActionListener(this);
          editMenu.add(mDelete);
          editMenu.addSeparator();
          mSelectAll = new JMenuItem(" Select All ");
          editMenu.add(mSelectAll);
          mSelectAll.addActionListener(this);
          mSelectAll.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_MASK));          
          toolsMenu.addSeparator();
          chkWordwrap = new JCheckBoxMenuItem(" WordWrap ");
          toolsMenu.add(chkWordwrap);
          chkWordwrap.addItemListener(this);
          toolsMenu.addSeparator();          
          mDateTime = new JMenuItem(" Date/Time ");
          toolsMenu.add(mDateTime);
          mDateTime.addActionListener(this);
          mDateTime.setAccelerator(KeyStroke.getKeyStroke("F5"));
          mAboutNotepad = new JMenuItem(" About Notepad ");
          aboutMenu.add(mAboutNotepad);
          mAboutNotepad.addActionListener(this);
     void addButton(JToolBar toolbar)
          btnOpen = new JButton(new ImageIcon("open.gif"));          
          btnOpen.setToolTipText("Open document");
          btnOpen.addActionListener(this);
          toolbar.add(btnOpen);
          btnOpen.setRequestFocusEnabled(false);
          btnOpen.transferFocus();
          btnNew = new JButton(new ImageIcon("new.gif"));     
          btnNew.setToolTipText("New Document ");
          btnNew.addActionListener(this);
          toolbar.add(btnNew);
          btnNew.setRequestFocusEnabled(false);
          btnNew.transferFocus();
          btnSave = new JButton(new ImageIcon("save.gif"));          
          btnSave.setToolTipText("Save document ");
          btnSave.addActionListener(this);
          toolbar.add(btnSave);
          btnSave.setRequestFocusEnabled(false);
          btnSave.transferFocus();
          toolbar.addSeparator();
          btnCut = new JButton(new ImageIcon("cut.gif"));          
          btnCut.setToolTipText("Cut selection");
          btnCut.addActionListener(this);
          toolbar.add(btnCut);
          btnCut.setRequestFocusEnabled(false);
          btnCut.transferFocus();
          btnCopy = new JButton(new ImageIcon("copy.gif"));          
          btnCopy.setToolTipText("Copy selection ");
          btnCopy.addActionListener(this);
          toolbar.add(btnCopy);
          btnCopy.setRequestFocusEnabled(false);
          btnCopy.transferFocus();
          btnPaste = new JButton(new ImageIcon("paste.gif"));
          btnPaste.setToolTipText("Paste selection ");
          toolbar.add(btnPaste);
          btnPaste.addActionListener(this);
          btnPaste.setRequestFocusEnabled(false);
          btnPaste.transferFocus();
          toolbar.addSeparator();
          env = GraphicsEnvironment.getLocalGraphicsEnvironment();
          String lsFonts[] = env.getAvailableFontFamilyNames();
          cmbFont = new JComboBox();
          cmbFont.setBackground(Color.white);
               for (int i = 0; i < lsFonts.length; i++)
                    cmbFont.addItem(lsFonts);
          cmbFont.addItemListener(this);
          cmbFont.setMaximumRowCount(15);
          toolbar.add(cmbFont);
               cmbFontSize = new JComboBox();
               cmbFontSize.addItemListener(this);
               cmbFontSize.setBackground(Color.white);
               cmbFontSize.setRequestFocusEnabled(false);
               for (int i = 8; i < 36; i+=2)
                         cmbFontSize.addItem(String.valueOf(i));
                         cmbFontSize.setSelectedItem("12");
          toolbar.add(cmbFontSize);
          toolbar.addSeparator();
     public void actionPerformed(ActionEvent e)
          if(e.getSource() == mNew || e.getSource() == btnNew || e.getSource() == popNew)
               if(textChanged)
                    int option = message();
                    if(option == 0)
                         new Save();
                         frame.setTitle(title);
                         txtArea.setText("");
                         txtArea.addKeyListener(this);
                         textChanged = false;
                    else if(option == 1)
                         frame.setTitle(title);
                         txtArea.setText("");
                         txtArea.addKeyListener(this);
                         textChanged = false;
                    else if(option == 2)
                         return;
               else
                    frame.setTitle(title);
                    txtArea.setText("");
                    txtArea.addKeyListener(this);
                    textChanged = false;
          else if(e.getSource() == mOpen || e.getSource() == btnOpen)
               if(textChanged)
                    int option = message();
                    if(option == 0)
                         new Save();
                         new Open();
                         txtArea.addKeyListener(this);
                         textChanged = false;
                    else if(option == 1)
                         new Open();
                         txtArea.addKeyListener(this);
                         textChanged = false;
                    else if(option == 2)
                         return;
               else
                    new Open();
                    txtArea.addKeyListener(this);
                    textChanged = false;
          else if(e.getSource() == mSave || e.getSource() == btnSave)
               new Save();
               txtArea.addKeyListener(this);
               textChanged = false;
          else if(e.getSource() == mSaveAs)
               new SaveAs();
          else if(e.getSource() == mPrint)
               PrinterJob printJob = PrinterJob.getPrinterJob();
               PageFormat type = printJob.pageDialog(printJob.defaultPage());
               Book bk = new Book();
               printJob.setPageable(bk);
               if(printJob.printDialog())
                    try
                         printJob.print();
          catch (Exception ex)
          else if(e.getSource() == mClose)
               if(textChanged)
                    int option = message();
                    if(option == 0)
                         new Save();
                         frame.setTitle(title);
                         txtArea.setText("");
                         txtArea.addKeyListener(this);
                         textChanged = false;
                    else if(option == 1)
                         frame.setTitle(title);
                         txtArea.setText("");
                         txtArea.addKeyListener(this);
                         textChanged = false;               
                    else if(option == 2)
                         return;
               else
                    frame.setTitle(title);
                    txtArea.setText("");
                    txtArea.addKeyListener(this);
                    textChanged = false;
          else if(e.getSource() == mExit )
               if(textChanged)
                    int option = message();
                    if(option == 0)
                         new Save();
                         JOptionPane.showMessageDialog(new JFrame(),"OH!!!please dont leave me!");
                         System.exit(1);
                    else if(option == 1)
                         JOptionPane.showMessageDialog(new JFrame(),"OH!!!please dont leave me!");
                         System.exit(1);
                    else if(option == 2)
                         return;
               else
                    JOptionPane.showMessageDialog(new JFrame(),"OH!!!please dont leave me!");
                    System.exit(1);
          else if(e.getSource() == mCut || e.getSource() == btnCut || e.getSource() == popCut)
               txtArea.cut();
               textChanged = true;
          else if(e.getSource() == mCopy || e.getSource() == btnCopy || e.getSource() == popCopy)
          {     txtArea.copy();}
          else if(e.getSource() == mPaste || e.getSource() == btnPaste || e.getSource() == popPaste)
               txtArea.paste(); textChanged = true;
          else if(e.getSource() == mDelete)
               txtArea.replaceSelection(null);     textChanged = true;
          else if(e.getSource() == mDateTime )
               txtArea.insert(currentTime(), txtArea.getCaretPosition());
               textChanged = true;
          else if(e.getSource() == mAboutNotepad)
               help();
          public void itemStateChanged(ItemEvent ie)
          if(ie.getSource() == chkWordwrap)
               if(chkWordwrap.getState())
               {     txtArea.setLineWrap(true);     }
               else
               {     txtArea.setLineWrap(false);}
          else if(ie.getSource() == cmbFont)
               fontChoice = (String)cmbFont.getSelectedItem();
          else if(ie.getSource() == cmbFontSize)
               FontSize = new Integer((String)cmbFontSize.getSelectedItem());
          txtArea.setFont(new Font(fontChoice,Font.PLAIN, FontSize.intValue()));
          public void keyTyped(KeyEvent ke)
          textChanged = true;
          mSave.setEnabled(true);
          btnSave.setEnabled(true);
          mSaveAs.setEnabled(true);
          txtArea.removeKeyListener(this);
     public void keyPressed(KeyEvent ke)
     public void keyReleased(KeyEvent ke)
     public int print(Graphics g, PageFormat pf, int pi) throws PrinterException
          if (pi >= 1)
               return Printable.NO_SUCH_PAGE;
          return Printable.PAGE_EXISTS;
     final static int message()
          JFrame frameMessage = new JFrame();
          Object message = "The text in the file has changed........Do u want to save the changes?";
          return JOptionPane.showConfirmDialog(frameMessage, message, " Save ", JOptionPane.YES_NO_CANCEL_OPTION);
     protected final class AppCloser extends WindowAdapter
          public void windowClosing(WindowEvent e)
               if(textChanged)
                    int option = message();
                    if(option == 0)
                         new Save();
                         JOptionPane.showMessageDialog(new JFrame(),"OH!!!please dont leave me!");
                         System.exit(1);
                    else if(option == 1)
                         JOptionPane.showMessageDialog(new JFrame(),"OH!!!please dont leave me!");
                         System.exit(1);
                    else if(option == 2)
                         return;
               else
                    JOptionPane.showMessageDialog(new JFrame(),"OH!!!please dont leave me!");
                    System.exit(1);
     class PopupListener extends MouseAdapter
          public void mousePressed(MouseEvent e)
          {     showPopup(e);     }
          public void mouseReleased(MouseEvent e)
          {          showPopup(e);     }
          private void showPopup(MouseEvent e)
               if(e.isPopupTrigger())
                    popMenu.show(e.getComponent(), e.getX(), e.getY());
     private void createActionTable(JTextArea textArea)
          actions = new Hashtable();
          Action[] actionsArray = txtArea.getActions();
          for (int i = 0; i < actionsArray.length; i++)
               Action a = actionsArray[i];
               actions.put(a.getValue(Action.NAME), a);
     private Action getActionByName(String name)
return(Action)(actions.get(name));
     class Open
          public Open()
               JFrame frame;
               FileDialog openFile;
               frame = new JFrame();
               frame.setLocation(150,150);
               openFile = new FileDialog(frame, " Open ", 0);
               openFile.show();
               String dirName = openFile.getDirectory();
               String fileName = openFile.getFile();
               if(dirName == null || fileName == null)
               {     return;     }
               else
                    try
                         FileInputStream readFile = new FileInputStream(dirName + fileName);
                         int fileSize = readFile.available();
                         byte inBuff[] = new byte[fileSize];
                         int readByte = readFile.read(inBuff, 0, fileSize);
                         readFile.close();
                         Notepad.txtArea.setText(new String(inBuff));
                         Notepad.frame.setTitle(openFile.getFile());
                    catch(Exception e)
                         Object warn = "Unable to open";
                         JOptionPane.showMessageDialog(new JFrame(), warn, "Warning.....", JOptionPane.WARNING_MESSAGE );
     class Save
          JFrame frameSave;
          FileDialog saveFile;
          String fileName = frame.getTitle();
          public Save()
               if(title == fileName)
                    frameSave = new JFrame();
                    frameSave.setLocation(150,150);
                    saveFile = new FileDialog(frameSave, " Save ", 1);
                    saveFile.show();
                    fileName = saveFile.getDirectory() + saveFile.getFile();
                    if(fileName.length() == 8)
                         return;
                    else
                         Notepad.frame.setTitle(saveFile.getFile());
               try
                    FileOutputStream writeFile = new FileOutputStream(fileName);
                    System.out.flush();
                    String input = Notepad.txtArea.getText();
                    for (int n = 0; n < input.length(); n++ )
                         writeFile.write(input.charAt(n) );
                    writeFile.close();
               catch (Exception e)
                    Object warn = "Unable to save file.........";
                    JOptionPane.showMessageDialog(new JFrame(), warn, "Warning.....", JOptionPane.WARNING_MESSAGE );
          btnSave.setEnabled(false); mSave.setEnabled(false); mSaveAs.setEnabled(false);
     class SaveAs
          public SaveAs()
               JFrame frameSaveAs = new JFrame();
               frameSaveAs.setLocation(150,150);
               FileDialog saveFileAs = new FileDialog(frameSaveAs, " Save As ", 1);
               saveFileAs.show();
               String fileName = saveFileAs.getDirectory() + saveFileAs.getFile();
               if(fileName.length() == 8)
                    return;
               else
                    Notepad.frame.setTitle(saveFileAs.getFile());
               try
                    FileOutputStream writeFile = new FileOutputStream(fileName);
                    System.out.flush();
                    String input = Notepad.txtArea.getText();
                    for (int n = 0; n < input.length(); n++ )
                         writeFile.write(input.charAt(n) );
                    writeFile.close();
               catch (Exception e)
                    Object warn = "Unable to save file.........";
                    JOptionPane.showMessageDialog(new JFrame(), warn, "Warning.....", JOptionPane.WARNING_MESSAGE );
here is the code for clock
import java.awt.Graphics;
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.text.DateFormat;
//<Applet code=ClockDemo5 Height=500 Width=600>
//</Applet>
//Clock with beep & buttons tried to enter alam settings into the applet itself
//instead of using dialog but still unsucessful
public class ClockDemo5 extends Applet implements ActionListener,Runnable {
     private Thread clock=null;
     Graphics g,g1;
     Image i1;
     int flag =0,fl=0;
     int beep=0;
     AudioClip clockbeep;
     String months[]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
     String msg="";
     Button setalarm, stopalarm, help ,ok,cancel;
     Label hrlabel,minlabel;
     TextField hrtxt,mintxt;
     public void init(){
          try{
               clockbeep=getAudioClip(getDocumentBase(),"clockbell.au");
               showStatus("Created by : Yogesh Raje");
               setalarm=new Button("Set Alarm");
               stopalarm=new Button("Stop Alarm");
               help=new Button("Help");
               hrlabel=new Label("Enter Hour : ");
               hrtxt=new TextField(2);
               minlabel=new Label("Enter Minutes : ");
               mintxt=new TextField(2);
               ok=new Button("Ok");               
               cancel=new Button("Cancel");
               add(setalarm);
               add(stopalarm);
               add(help);
               add(hrlabel);
               add(hrtxt);
               add(minlabel);
               add(mintxt);
               add(ok);
               add(cancel);
               hrlabel.setVisible(false);
               hrtxt.setVisible(false);
               minlabel.setVisible(false);
               mintxt.setVisible(false);
               ok.setVisible(false);
               cancel.setVisible(false);
               setalarm.addActionListener(this);
               stopalarm.addActionListener(this);
               help.addActionListener(this);
               ok.addActionListener(this);
               cancel.addActionListener(this);
          catch(Exception e){
               showStatus("Unable To Load Audio Clip");
     public void start(){
          showStatus("Created by : Yogesh Raje");
          if(clock==null){
               clock=new Thread(this,"clock");
               clock.start();
     public void actionPerformed(ActionEvent ae){
          String str=ae.getActionCommand     ();
          flag=1;
//          if(str.equals("Set Alarm")){
          if(ae.getSource()==setalarm){
               hrlabel.setVisible(true);
               hrtxt.setVisible(true);
               minlabel.setVisible(true);
               mintxt.setVisible(true);
               ok.setVisible(true);
               cancel.setVisible(true);
          else if(str.equals("Stop Alarm")){
          else if(str.equals("Help"))
               msg="About help";
          mypaint();
     public void run(){
          showStatus("Created by : Yogesh Raje");
          Thread myclock=Thread.currentThread();
          g=getGraphics();
          i1=createImage(500,600);
          g1=i1.getGraphics();
          g1.setFont(new Font("Dialog",Font.BOLD,48));
          while(myclock==clock){
               try{
                    beep--;
                    mypaint();
                    Thread.sleep(1000);
               }catch(InterruptedException e){}
     public void mypaint(){
          Dimension d=getSize();
          Calendar cal=Calendar.getInstance();
          Date time=cal.getTime();
          DateFormat dateformat=DateFormat.getTimeInstance();
          int s=90+cal.get(Calendar.SECOND)*-6;
          int m=90+cal.get(Calendar.MINUTE)*-6;
          int h=90+cal.get(Calendar.HOUR)*-30+(int)(cal.get(Calendar.MINUTE)*-0.5);     
          //if(cal.get(Calendar.SECOND)==0 && cal.get(Calendar.MINUTE)==0){
               fl=1;
               beep=cal.get(Calendar.MINUTE);
          if(fl==1)
               clockbeep.play();
          if(beep==1)
               fl=0;
          //if(cal.get(Calendar.HOUR)==Integer.parseInt(cd.h1) && cal.get(Calendar.MINUTE)==Integer.parseInt(cd.m1))
               //clockbeep.loop();
          showStatus("Created by : Yogesh Raje");          
          g1.setColor(Color.white);
          g1.fillRect(0,0,100,150);
          g1.setColor(Color.black);
          g1.drawString(beep+"",25,125);
          //g1.drawString(s1+"",25,35);
          g1.setColor(Color.black);
          g1.fillOval(d.width/2-200,d.height/2-200,400,400);
          g1.setColor(Color.orange);
          g1.fillOval(d.width/2-175,d.height/2-175,350,350);
          g1.setColor(Color.white);
          g1.setFont(new Font("Dialog",Font.BOLD,25));
          g1.fillRect(0,450,600,30);
          g1.setColor(Color.red);
          g1.drawString(dateformat.format(time),100,475);
          g1.drawString(""+months[cal.get(Calendar.MONTH)]+" "+cal.get(Calendar.DATE)+" "+cal.get(Calendar.YEAR),350,475);
          g1.setColor(Color.white);
          g1.setFont(new Font("Dialog",Font.BOLD,50));
          g1.drawString("12",267,125);
          g1.drawString("6",282,412);
          g1.drawString("9",132,270);
          g1.drawString("3",437,270);
          g1.setColor(Color.black);
          g1.fillArc(d.width/2-75,d.height/2-75,150,150,h,2);
          g1.setColor(Color.gray);
          g1.fillArc(d.width/2-100,d.height/2-100,200,200,m,2);
          g1.setColor(Color.green);
          g1.fillArc(d.width/2-125,d.height/2-125,250,250,s,1);
          g1.fillOval(d.width/2-5,d.height/2-5,10,10);
          g1.setFont(new Font("Dialog",Font.BOLD,18));
          g1.setColor(Color.black);
          if(flag==1){
               flag=0;
               g1.setColor(Color.white);
               g1.fillRect(0,0,225,50);
          g1.drawString(msg,5,40);
          g.drawImage(i1,0,0,null);
     public void stop(){
          clock=null;
please help me! i beg for ur help!!!!!!!!

application->applet
get rid of static variables. if nothing else helps put all your static variables in a class that does nothing but holding them and initialize only one such class and add a reference to it in every of your classes.
whatever you have done in the main method do it now in the constructor of that class.
from your applet (or if you have none make one that does nothing else) construct an instance of that class
applet->application
put all you have drawn directly on the applet ontpo some sort of window.
change the init method to a constructor.
make a class with a main method that constructs such an exapplet

Similar Messages

  • Applets and application problem plz help me

    Sir
    i design some buttons in cofeecup applet button factory
    it gives me an applet code.i design all drop down menus
    now i want to and it in my application
    by using a JSplitpane How can i add them in my application
    thanks in advance

    Creating a GUI with Swing
    http://java.sun.com/docs/books/tutorial/uiswing/

  • Code of applets and applications

    When I'm writing the beginning of the code for a application I would write:
    public class whatever
    public static void main (String [] args)
    does this differ when writing the beginning for an applet? can i just write it like above and add the applet tags in html?
    thanks for reading.
    -keyf

    public class whatever extends jappletis fine, but an applet does not have a main() method.
    It has a
    public void init() {}
    that works like a constructor (run the first time the page containing the applet is loaded)
    and a method
    public void start() {}
    that would be similar to the main().
    HTH,
    Dewang

  • Question regarding Applet and JVM

    Hi all!
    I'm working on an applet now and it's been working quite fine, just that when I run the same applet on different tab in a single browser window, it'll get some error.
    But if I run the applets in different windows, it'll be fine.
    So I'd like to know how does JVM handle the execution of applet?
    What is the difference between:
    - how JVM handles multiple applet in different-tab-in-single-browser and
    - how JVM handles multiple applet in different browser?
    Any help is greatly appreciated :)
    Thanks in advance ^^

    Sounds like you're using static fields. Not a good idea in applets because...
    What is the difference between:
    - how JVM handles multiple applet in different-tab-in-single-browser and
    - how JVM handles multiple applet in different browser?
    ...that's entirely up to the browser. Actually, your question's slightly misconstrued. What you should really ask is,
    What is the difference between:
    - how the browser spawns JVMs in different-tab-in-single-browser and
    - how the browser spawns JVMs in different browser?
    Either way, it's out of your hands. Which is why you're going to have to be very careful about using statics: if you use them for state information then another applet can trash them; if you use them for inter-applet communication you might not reach one applet from another.

  • Socket communication failure between Java applet and C++ application

    I have a java applet that connects to a C++ application via Java's ServerSocket and Socket objects. THe C++ application is using the Winsock 2 API. The applet and application are running on an NT workstation (SP 6) and using IE (5.5) For a very simple C++ test applications the communictions work fine. Once more code gets added to the C++ application the portion of the socket that C++ listens to seems to close. Upon performing a recv call the return value is a zero. Microsoft insists this is a sign the Java side has shut down the socket. The Java applet can still receive messages from the C++ app but C++ cannot receive responses from the Java side. Java throws no exceptions and an explicit check of the socket shows no errors. Again, what puzzles me is that it works for simple C++ applications. Are there any known conflicts between Java and C++ in this regard?
    I have inlcuded the basic java code segments below.
    / run Method.
      * This method is called by the Thread.start() method. This
      * method is required for the implementation of the Runnable interface
      * This method sets up the server side socket communication and
      * contiuously loops looking for requests from a external
      * socket.
      * @author Chris Duke
      public void run(){
         // create socket connections
         boolean success = false;
         try {
             cServerSocket = new ServerSocket(cPortID);
             System.out.println("Waiting for client to connect...");
             cClientSocket = cServerSocket.accept();
             System.out.println("Client connected");
             // Create a stream to read from the client
             cInStream = new BufferedReader(new InputStreamReader(
               cClientSocket.getInputStream()));
             // Create a stream to write to the client       
             cOutStream = new PrintWriter(
               cClientSocket.getOutputStream(), true);
             success = true;
         }catch (IOException e) {
             System.out.println("CommSocket:Run - Socket Exception(1) " + e);
             success = false;
         // if the socket was successfully created, keep the thread running
         while (success){
             try{
                // check socket to see if it is still available for reading
                if (cInStream != null && cInStream.ready()){
                    // check for an incoming message
                    String message = ReceiveMessage();
                    // Send message to listeners
                    Event(message);
                if (cInStream == null){
                    success = false;
                    System.out.println("CommSocket:Run - shutdown");
             }catch (IOException e){
                System.out.println("CommSocket:Run - Socket not ready exception");
                break;
    // SendMessage method -
      *  Sends a text message to a connected listener through port specified by portID
      * @author Chris Duke
      * @param  String message - This will be the message sent out through the server
      * socket's port specified by portID.
       public void SendMessage(String message){
          cOutStream.println(message);
          if (cOutStream.checkError() == true)
            System.out.println("SendMessage : Flush = Error");
          else{
            System.out.println("SendMessage : Flush - No Error");
       }

    a very simple C++ test applications the communictions work fine. Once more code gets added to the C++ application the portion of the socket that C++ listens to seems to close.
    This quite strongly implicates the extra code in the C++ App. The firstly thing I would try would be telnet. Try connecting to both versions of the C++ Application and manually reproducing a proper exchange.
    a recv call the return value is a zero. Microsoft insists this is a sign the Java side has shut down the socket.
    A correct implementation of recv should return the number of bytes received, or -1 for an error. A zero return indicates no bytes received not a socket closed/error. This sounds like FUD to me.
    Are there any known conflicts between Java and C++ in this regard?
    I can see no obvious faults, though the code is incomplete, I don't think it's an sockets implementation issue, at either end, it sounds more likely to be a protocol/handshaking bug in the C++ App.

  • I'm crazy!Applet and JNA Error:Library 'jnidispatch' was not found!

    Hi all,
    sorry to bother you, I really have no idea how to do JNA and Applet. I'm hardly mazy, man.
    Every time it will throw an error to me :
    Exception in thread "thread applet-JNAApplet-1" java.lang.UnsatisfiedLinkError: Library 'jnidispatch' was not found by class loader sun.plugin2.applet.JNLP2ClassLoader@291aff
         at com.sun.jna.Native.getWebStartLibraryPath(Native.java:858)
         at com.sun.jna.NativeLibrary.<clinit>(NativeLibrary.java:576)
         at com.sun.jna.Library$Handler.<init>(Library.java:140)
         at com.sun.jna.Native.loadLibrary(Native.java:372)
         at com.sun.jna.Native.loadLibrary(Native.java:357)
         at JNAApplet.init(JNAApplet.java:15)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)My program is so easy, I just want use Applet to revoke JNA and use the JNA to load a native lib.
    here is the structure of my program:
    Applet code :
    import javax.swing.JApplet;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import com.sun.jna.Native;
    public class JNAApplet extends JApplet {
         public static Kernel32 kernel32 = null;
         @Override
         public void init() {
              createGUI();
              kernel32 = (Kernel32)Native.loadLibrary("Kernel32", Kernel32.class);
              if (kernel32 == null) {
                   System.out.println("load kernel32 fail!");
              } else {
                   System.out.println("load kernel32 success!");
         private void createGUI() {
              JPanel panelCenter = new JPanel();
              JButton butTest = new JButton("Test");
              panelCenter.add(butTest);
              setContentPane(panelCenter);
    }When I run it on debug mode, it is ok! but when I deploy it , it will throw above error message to me.
    My Applet html:
    <html>
         <head>
              <title>JNA Applet</title>
         </head>
         <body>
         <script src="deployJava.js"></script>
        <script>
            var attributes = { code:'JNAApplet',  width:300, height:300} ;
            var parameters = {jnlp_href: 'JNAApplet.jnlp'} ;
            deployJava.runApplet(attributes, parameters, '1.5');
        </script>
         </body>
    </html>File 'JNAApplet.jnlp':
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="" href="">
        <information>
            <title>JNA Applet</title>
            <vendor>Steven</vendor>
        </information>
        <resources>
            <j2se version="1.5+"
                  href="http://java.sun.com/products/autodl/j2se" />
            <jar href="JNAApplet.jar" main="true" />
        </resources>
        <applet-desc
             name="JNA Applet"
             main-class="JNAApplet"
             width="300"
             height="300">
         </applet-desc>
         <update check="background"/>
    </jnlp>     I really have no idea. and I can't search any usefull infomation from Google and officer site.
    Can any one help me? Thank you very much!!!!

    Hi AndrewThompson64:
    Did you mean the JNA project? Or are you refering to JNI, or ..something else?Yes, I mean is that I wanna jna.jar to replace JNI to code with Applet. I want Applet can run native library(.dll files).
    That reads like so much nonsense to me.Sorry fo that.
    Was there any 'caused by' part that you trimmed? I expected to see something to do with 'Security' or 'AccessControl'.Sorry, I can't saw any 'cause by' subsentence there. This message is just gain from Applet Console.(Is there any method to gain more message?)
    About 'Security' and 'AccessControl' I just modify my java.policy file to allpermission. Subsequently, I signed all jar files.
    For now I have 3 jar files(all have been signed ):
    --example.jar :  for this little program.(code include applet and application entry)
    --jna.jar
    --win32-x86.jar : include kernel32.dll and jnidispatch.dll for win32 and x86.
    and 2 JNLP files:
    --JNAApplet.jnlp the entry is JNAApplet.class (this jnlp does not work)
    --JNAApp.jnlp     the entry is JNAApp.class  (this jnlp works)
    And for now new error message show like this:
    Exception in thread "thread applet-JNAApplet-1" java.lang.UnsatisfiedLinkError: Library 'Kernel32' was not found by class loader sun.plugin2.applet.JNLP2ClassLoader@4aeb52
         at com.sun.jna.Native.getWebStartLibraryPath(Native.java:858)
         at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:97)
         at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:228)
         at com.sun.jna.Library$Handler.<init>(Library.java:140)
         at com.sun.jna.Native.loadLibrary(Native.java:372)
         at com.sun.jna.Native.loadLibrary(Native.java:357)
         at JNAApplet.init(JNAApplet.java:12)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Did you mean invoke?
    Revoke: To annul by withdrawing.
    Invoke: To call on.Yes, you got it. Thank you.
    The JNLP file is invalid. ..I was about to put my 'standard' text here, but I'm sick of saying it. Search the forum for my posts - 50% of them, at least, mention validation and how to go about it.
    Also, the applet-desc requires a documentbase.Thank you, I really think I have some invalid section. But I can't find it, and you said 'Search the forum for my posts - 50% of them...' , I can read the JNLP structure on site of sun and I can to read you post too(I'm doing like this).*I only want to know about how to load "native lib like *.dll" properly*.
    What 'officer site'?I mean jna project site. Sorry for ambiguity.
    Please fix that sticky '!' key. One '!' indicates astonishment, while two or more typically indicates a bozo. Thanks for your advice. Because I tried to find solution do my best lasting two days. I got nothing. I'm sadness.
    here post my new files:
    import javax.swing.JFrame;
    import com.sun.jna.Native;
    public class JNAApp {
         public static Kernel32 kernel32 = null;
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              kernel32 = (Kernel32)Native.loadLibrary("Kernel32", Kernel32.class);
              JFrame frame = new JFrame();
              frame.setSize(500, 500);
              frame.setVisible(true);
    import javax.swing.JApplet;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import com.sun.jna.Native;
    public class JNAApplet extends JApplet {
         public static Kernel32 kernel32 = null;
         public void init() {
              createGUI();
                   kernel32 = (Kernel32)Native.loadLibrary("Kernel32", Kernel32.class);
         private void createGUI() {
              JPanel panelCenter = new JPanel();
              JButton butTest = new JButton("Test");
              panelCenter.add(butTest);
              setContentPane(panelCenter);
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="" href="">
        <information>
            <title>JNA Applet</title>
            <vendor>Steven</vendor>
        </information>
        <resources>
            <j2se version="1.5+"
                  href="http://java.sun.com/products/autodl/j2se" />
             <jar href="JNAApplet.jar" main="true"/>
             <jar href="jna.jar"/>
        </resources>
           <resources os="Windows" arch="x86">
             <nativelib href="win32-x86.jar"/>
             <nativelib href="kernel32.jar"/>
           </resources>
        <applet-desc
             documentBase=""
                name = "success"
             main-class="JNAApplet" width = "200" height = "200">
         </applet-desc>
         <update check="background"/>
           <security>
             <all-permissions/>
           </security>
    </jnlp>     
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="" href="">
        <information>
            <title>JNA Applet</title>
            <vendor>Steven</vendor>
        </information>
        <resources>
            <j2se version="1.5+"
                  href="http://java.sun.com/products/autodl/j2se" />
             <jar href="JNAApplet.jar" main="true"/>
             <jar href="jna.jar"/>
        </resources>
           <resources os="Windows" arch="x86">
             <nativelib href="win32-x86.jar"/>
             <nativelib href="kernel32.jar"/>
           </resources>
        <application-desc
             main-class="JNAApp">
         </application-desc>
         <update check="background"/>
           <security>
             <all-permissions/>
           </security>
    </jnlp>     Thanks & Best Regards,
    Su Heng

  • Applet or application wont compile now?

    I recently got a new computer at work. After I set everything up, including jre & sdk 1.4.1, and path file ifno on my windows xp box (same setup as the other machine), my same applications are now throwing errors?
    It's as if for some reason my old setup was more lax on catching compile time errors.
    Whats even weirder, is the old applets and applications compiled on my old machine still run fine and if I try to compile the old applets and applications without resaving them, I get no error, its just after I resave them, even if I only add a blank line to the file.
    any suggestions
    Jason

    any suggestionsYes, tell us what the errors are exactly! And you should probably show relevant parts of the code too.

  • HELP! How to get an applet and place it into an application?

    Hi,
    We have a third party java applet that runs on a specific server. We don't have the code for this applet, only the .class file. We usually connect to the server using any browser with HTTP protocole like http://ourServer. Then we are asked for our username and password and then the applet loads and we can run it. The applet is design to remotely control a piece of equipment. The applet runs on the server and directly coomunicate with this piece of equipment and gives us bak some information into a graphic interface.
    What we want to do is to integrate the applet into one of our stand alone application to eliminte the need for a browser. Since Applet can be add directly into any Panel I've tried something like :
    public myApp() {
         Container c = getContentPane();
         ThirdPartyApplet myApplet = new ThirdPartyApplet();
         c.setLayout(new BorderLayout());     
         c.add(myApplet,BorderLayout.CENTER);
         myApplet.init();
    Of course I've a local copy of the .class file and I've included it into my ClassPath. I can get the interface this way but I can't run it, nothing seems to work.
    I'm not an expert in applet, I don't know how this one works, but it seems that we need to get the one on the server and run it, just as a browser would do. We've also tried to integrate a Browser into our app. We've tried NetClue and IceBrowser but only IceBrowser seems to work perfectly with our applet and we don't have the money for an IceBrowser license.
    So what is wrong with the integration of an applet into a stand alon application?? How do I simulate a Browser and get the applet from the server?
    Can anyone help me on this one?
    Thanks
    Steeves

    There's a link to download the Java source on this page.
    http://java.sun.com/j2se/downloads.html
    Once you have it, look for the appletviewer source in
    src\share\classes\sun\applet

  • IIS, Javascript, Signed Applet and ASP Blank Page Problem

    Hi,
    I'm having a problem using a Signed Applet in a site that runs in a IIS (Windows Server 2003).
    My aspx web page uses the applet to read my smart card and get information from it.
    This applet uses an auxiliar dll (stored in a second Signed Jar file) in order to read the information from my smart card.
    The way the solution is design:
    1) Aspx page is asked from server
    2) Internet Explorer recieve the page and asks the server for it content (images, applet, javascripts, etc)
    3) After this the JVM runs (console opens)
    4) After the Aspx page render fully a javascript register onload fires and call an applet method
    5) Applet receive the call and run the logic of the method:
         - reads the smart card;
         - calls Javascript function in order to fill aspx fields with information from smart card
         - calls Javascript function the simulates a click in a botton of aspx page (in order to call server side part sending data readed from smart card to server)
    5) The server makes some logic with the information receive and responds to client registering in aspx page a call to another Javascrit function
    6) The client received the asnwer from server and runs the Javascript function registered on step 5)
         This Javascript calls another method from applet and runs the following logic:
         - reads more information from smart card;
         - call javascript function in order to fill more fields of aspx page with the information readed
         - calls Javascript function the simulates a click in a botton of aspx page (in order to call server side part sending data readed from smart card to server)
    7) The server makes some logic and call another pages with no Applets
    8) Client asks for a second page with the same applet and we start with another logic express on steps 1);2);3),4);5) and then 7).
    This is all ok, until sometimes the server stop responding correcly for requests regarding this two pages with the Applet.
    When this happens the server just responds with a blank page.
         - with fiddler I can seer the request for the aspx page (that uses the applet)
         - but server responds with a blank html page
    The JVM doesn't fire.
    The IIS log don't show errors.
    The eventviewer doesn't show errors.
    The problem is solved with an IIS reset or a Application Pool reset.
    After a while the problem returns.
    This problem occours for other user in another machine, the server just stops responding correcly to request regarding pages with applets, the other pages still continue to work.
    If we disable Java Control Panel->Advanced->Java Plug-in->Enable the next-generation Java Plug-in the problem seend to stop, but we can't force all clients to disable this option right?
    Or there is a way to force the Applet to run with this option disabled?
    As anyone experience similar problem?
    Regards,
    OF

    This is all ok, until sometimes the server stop responding correcly for requests regarding this two pages with the Applet.
    When this happens the server just responds with a blank page.
    - with fiddler I can seer the request for the aspx page (that uses the applet)
    - but server responds with a blank html pageWell, if http requests look identical in case of success and failure (pay attention to cookies, etc) then it has to be something on the server side.
    It could be that server gets into this wrong state because of previous requests made by applet but it is hard to tell.
    I am not clear how old/new plugin can make a difference unless your applets run in the legacy mode (i.e. you are actually trying to reuse SAME instance of the applet when
    it is loaded next time).
    I'd start with
    1) carefully comparing good/bad sessions
    2) checking whether server will serve correct response to another client when it serves "bad" page for current client
    3) add debug statements to aspx - it is scripted page, may be some condition is not met and then it returns blank?
    4) record all http requests in one session until you get to "error" state and then use any http server testing tool to "replay" this set of requests.
    You should be able to get server into the same state without use of applet. Then you can try to tweak set of requests to see what makes a difference.

  • Global Web Applets and My Custom Home Page Report

    Hello,
    I setup a custom "My Home Page Report" which is great but does not display the report when you load the home page without clicking the "Generating analysis... Click here to view the results" link. Is there a way around this?
    I then setup a a Global Web Applet and embedded this on the main home page. When doing this I found you cannot have 1 section that spans the entire width of the page as you can with a report (To my knowledge?). I then tried putting two Custom Web Applets side by side to display the graph and report I wanted. This works however, I have vertical scroll bars although the reports are perfectly displayed and do not require any scrolling. Is there a way to get rid of the scroll bars?
    Regards
    Innoveer

    Innoveer, you can contact customer care and ask them to provision your On Demand application with the custom homepage "Execute Report Immediately" option. However, you want to make sure that this custom report loads quickly - if not it will delay the loading of your homepage.

  • Decompile applet and proxify all URL and socket connection and recompile

    Hi,
    Please anybody have idea for the below.
    I need to decomple the applet class file to .java file and need to change all URL and Socket connection to proxify all connections from applet. and recompile the sample applet to make ready to load in browser.
    Thi is to load the applet form the web server through one proxy server. In the proxy server side While loading the applet from web server that applet code need to be changed to modify the URL and connections used in that applet to change the further connection from applet through proxyserver.
    Compile and decompile is not a problem that i can use javac and javap respectively.
    But I want to know how to change all URL and connection in applet. is there any easy way to handle this with out changing the applet code.
    can Anybody help me.
    Thanks and Regards,
    Shiban.

    Not sure how you do that:
    Client <----[HTTPS]-----> Secure Gateway <------[HTTP]------->Web servers
    or
    Internet Explorer/Mozilla <----[HTTPS]-----> proxy <------[HTTP]-------> Google
    Is the above correct?
    If so than what are the proxy settings in IE/Moz, I can specify the proxy address in the
    browsers but not the proxy type (SSL).
    When you want to visit a page like google I gues you just type http://www.google.com in
    the browsers address bar. The browser will figure out how to connect to the proxy.
    Java has got the control panel in the general tabl there is a button "network settings...:"
    I have it to "use browser settings" and this works for me.
    All URL and URLConnections work but the sockets don't (maybe put in a bug report)
    for example games.yahoo.com -> card games -> bridge -> create table
    In the trace I can see:
    network: Connecting http://yog70.games.scd.yahoo.com/yog/y/b/us-t1.ldict with proxy=HTTP @ myproxy/00.00.00.00:80
    network: Connecting socket://yog70.games.scd.yahoo.com:11999 with proxy=DIRECT
    The second one fails because port 11999 is not open (what idiot uses an unassigned
    port for a profesional site is beyond me).
    http://www.iana.org/assignments/port-numbers
    #               11968-11999 Unassiged
    Even if the port was open on the proxy you'll notice with proxy=DIRECT that
    "use browser settings" does not work with socket (bug report??).
    Anyway my advice is to open the java console (windows control panel or javacpl.exe in
    the bin dir of java.home) and make sure it is set to "use browser settings"
    Then enable a full trace:
    To turn the full trace on (windows) you can start the java console, to be found here:
    C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
    In the advanced tab you can fill in something for runtime parameters fill in this:
    -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
    if you cannot start the java console check here:
    C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
    I think for linux this is somewhere in youruserdir/java (hidden directory)
    add or change the following line:
    javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    for 1.5:
    deployment.javapi.jre.1.5.0.args=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    The trace is here:
    C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
    I think for linux this is somewhere in youruserdir/java (hidden directory)
    Print out the full trace of the exception:
    try{...}catch(Exception e){e.printStackTrace();}
    Then visit the games.yahoo and try to create a new table playing bridge.
    Inspect the trace and see if it works/why it doesn't work.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Signed applets and restrictions ?

    Hello,
    I've a question regarding applets security : in fact I've tried to sign myself a Jar file containing all required classes for an application (using the jarsigner tool from Sun). However I'm still getting security problems even of it was digitally signed ans don't understand exactly the causes : Could somebody explain me them ? I understood that I had to sign the Jar files using an official authority like Verisign to get all permissions, is it true ? Would it mean that we can't get these permissions without paying any submissions ?
    TU a lot...
    PA
    http://wwww.doffoel.com

    I understood that I had to sign the Jar files using an official authority like Verisign to get all permissions, is it true ?
    Its not compulsory to go to verisign for signing your applet. You can also create your own certificates with Java's keytool. Its 200% free of cost. However, if you are inclined to build a commercial application, where you don't know the clients, who download the applet, get certs from verisign , Thales et al.
    Would it mean that we can't get these permissions without paying any submissions ?
    No. Not at all. You can always make a descent application without going to the standard certificates and without paying $$$.
    Post your quetions in http://forum.java.sun.com/forum.jsp?forum=63 for expert answers.
    Have a look at this famous thread for signing applets.
    http://forum.java.sun.com/thread.jsp?forum=63&thread=132769
    good wishes,
    Rajesh

  • What is the diffrence between sap events and application events

    Hi all,
    what is the diffrence between sap events and application events.Can any one tell me with examples.
    regards,

    Hi,
    Look at this,
    <b>System Events (Default)</b>
    The event is passed to the application server, but does not trigger the PAI. If you have registered an event handler method in your ABAP program for the event (using the SET HANDLER statement), this method is executed on the application server.
    Within the event handler method, you can use the static method SET_NEW_OK_CODE of the global class CL_GUI_CFW to set a function code and trigger the PAI event yourself. After the PAI has been processed, the PBO event of the next screen is triggered.
    The advantage of using this technique is that the event handler method is executed automatically and there are no conflicts with the automatic input checks associated with the screen. The disadvantage is that the contents of the screen fields are not transported to the program, which means that obsolete values could appear on the next screen. You can work around this by using the SET_NEW_OK_CODE method to trigger field transport and the PAI event after the event handler has finished.
    <b>Application Events</b>
    The event is passed to the application server, and triggers the PAI. The function code that you pass contains an internal identifier. You do not have to evaluate this in your ABAP program. Instead, if you want to handle the event, you must include a method call in a PAI dialog module for the static method DISPATCH of the global class CL_GUI_CFW. If you have defined an event handler method in your ABAP program for the event (using the SET HANDLER statement), the DISPATCH method calls it. After the event handler has been processed, control returns to the PAI event after the DISPATCH statement and PAI processing continues.
    The advantage of this is that you can specify yourself the point at which the event is handled, and the contents of the screen fields are transported to the application server beforehand. The disadvantage is that this kind of event handling can lead to conflicts with the automatic input checks on the screen, causing events to be lost.
    Hope u understood.
    Thanks&Regards,
    Ruthra.R

  • To convert applet-based application?

    Hi
    There are some tools on market to run an applet-based application on server side. Those tools convert the behavior of applet application to Jsp application. So they run the application on web server and send HTML to web browser.
    One of those tools is WebCream(www.creamtec.com)
    Would appreciate to let me know other tools or any other ways to achive this.
    Thanks in Advance.

    repost

  • Menu bar and application toolbar

    is there a way to change item text on menu bar and application toolbar  eg in business partner overview(T-Code fmcacov) i want to change text 'Business Partner" to "tax Payer" on both menu bar an application toolbar. i have tried the norma way of going to change the screen but when i am on the GUI status its not going to change mode even sfter entering the access key

    Hi ,
    Open the program and click on GOTO=>ATTRIBUTES.
    Change the text to the heading which you want.
    SAVE & ACTIVATE.
    Regarding opening in change mode, the steps you have carried out are correct.
    You need to comment the existing gui-status by placing cursor on that line & click delete.
    Then click on INsert button and add new gui-status.
    Best regards,
    Prashant

Maybe you are looking for