How do I add in a MIDlet in a file like tis

Hi all,
Im very new to J2ME....I get an error on :
Unable to create MIDlet EchoServer
java.lang.InstantiationException: Class not a MIDlet
     at com.sun.midp.midlet.MIDletState.createMIDlet(+51)
     at com.sun.midp.midlet.Selector.run(+22)
And here's my source code.....
package javax.bluetooth;
import javax.bluetooth.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import java.io.*;
public class EchoServer extends MIDlet implements CommandListener, Runnable
     StreamConnectionNotifier notifier;
     StreamConnection conn;
     LocalDevice localDevice;
     ServiceRecord serviceRecord;
     InputStream input;
     OutputStream output;
     private Form serForm;
     private Command exitCommand = new Command("Exit", Command.EXIT, 1);
     private Display display;
     private boolean isInit;
     private static String serverUrl = "btspp://localhost:" + BluetoothEchoDemo.RFCOMM_UUID + ";name=rfcommtest;authorize=true";
     public EchoServer()
          display = Display.getDisplay(this);
          serForm = new Form("Server1");
          serForm.addCommand(exitCommand);
          serForm.setCommandListener(this);
          serForm.append(new StringItem(null, "\n\nServer Running..."));
     isInit = false;
     Thread thread = new Thread(this);
     thread.start();
     public void displayForm()
          display.setCurrent(serForm);
     public void startApp()
          displayForm();
     public void destroyApp(boolean unconditional){}
     public void pauseApp(){}
     public void commandAction(Command c, Displayable s)
          notifyDestroyed();
     public void run()
     if (!isInit)
          // Initialization is done in the thread to avoid dead lock 'isInit' ensures it is done once only
          try
          conn = null;
          localDevice = LocalDevice.getLocalDevice();
          localDevice.setDiscoverable( DiscoveryAgent.GIAC );
          notifier = (StreamConnectionNotifier)Connector.open(serverUrl);
          catch (BluetoothStateException e)
          System.err.println( "BluetoothStateException: " + e.getMessage() );
          catch (IOException e)
          System.err.println( "IOException: " + e.getMessage() );
          isInit=true;
          System.out.println( "Starting Echo Server" );
     try
          System.out.println("\n\nServer Running...");
          // Pauses thread until Transmission occurs
          conn = notifier.acceptAndOpen();
          // Read Data Transmission
          String msg = BluetoothEchoDemo.readData(conn);
          System.out.println("Received Message from Client: " + msg);
          // Send Back a Message
          msg = "Hello Back from Server";
          output = conn.openOutputStream();
          output.write(msg.length()); // length is 1 byte
          output.write(msg.getBytes());
          output.close();
     catch (Exception ex)
          System.err.println("Bluetooth Server Running Error: " + ex);
}

Hi,
http://java.sun.com/j2se/1.3/docs/tooldocs/win32/jar.html
http://bobcat.webappcabaret.net/javachina/faq/jar.htm
L.P.

Similar Messages

  • How do I add URI web link with custom tooltip like "CLICK HERE TO UPDATE" instead of URI web link in tooltip.

    How do I add URI web link with custom tooltip like "CLICK HERE TO UPDATE" instead of URI web link in tooltip.

    You've probably found an answer to this by now, but I think this has been addressed in another forum -- The link below suggested using a button and adding the tooltip to the button. 
    https://forums.adobe.com/thread/304974?start=0&tstart=0
    Sounds like it would work but I haven't actually tried it. 
    Good luck~!

  • How can I add a password to my PDF file ?

    I'd like to know How can I add a password to my PDF file ?
    Regards,

    Acrobat Help | Securing PDFs with passwords

  • How do you add a watermark to a protected file?

    How do you add a watermark to a protected file?

    Hi whobrew,
    Without the Document Permissions password, you won't be able to add a watermark to the PDF.
    Please let us know if you have additional questions.
    Best,
    Sara

  • How do we add trap-recipients to the acl file?

    How do we add trap-recipients to the acl file?
    Any examples.

    Here's some documentation I am working on for my place of work - hope this helps:
    There are two Sun-provided configuration files of note that must be maintained and provided to the SNMP agent program as command line arguments when it runs. They are:
    X.acl (subagent access control file, where X is your agent name)
    X.reg (subagent registration file, where X is your agent name)
    Note: For more information on either of these files, read the Solstice Enterprise Agents User Guide found on the Sun website, but don't expect too much.
    The reg file specifies the subagent name and OID tree it is responsible for, among other things.
    The acl file contains a list of communities that will be sent traps. This file will need to be periodically updated with the IP addresses of any entity that wants to receive traps from the X subagent. The file looks in part like this:
    acl = {
    communities = public, private
    access = read-write
    managers = dv, localhost
    trap = {                                                             
    trap-community = SNMP-trap
    hosts = dv, localhost
    enterprise="Xenterprise"
    trap-num = 1-5
    Where "dv" and "localhost" are configured in the /etc/hosts file as IP addresses to send traps to and "Xenterprise" is an enterprise that must be registered EXACTLY as is shown in the /etc/snmp/conf/enterprises.oid file. (Note: Some of the enterprises in this file have spaces within their name. This WILL NOT WORK. So if for some reason, an enterprise you were going to use is "MY Enterprise" you must changes this file because your MIB will not compile with an enterprise with spaces in the TRAP-TYPE declaration.
    So, to add a new community, add an argument to the "managers" and "hosts" line in the .acl file and ensure that this reference has its IP address listed in the /etc/hosts file.
    Furthermore, in /etc/snmp/conf/snmpdx.acl a comparable entry needs to be added as well. The snmpdx executable is the master agent that the subagent communicates with. It also has an entry in its .acl file as follows:
    trap = {                                                            
    trap-community = SNMP-trap
    hosts = dv, localhost
    enterprise="Xenterprise"
    trap-num = 1-5

  • How do you save a webpage as a single file like internet explorer

    how do you save a webpage as a single file like internet explorer

    *Mozilla Archive Format: https://addons.mozilla.org/firefox/addon/mozilla-archive-format/
    *UnMHT: https://addons.mozilla.org/firefox/addon/unmht/

  • How do I add to "properties" of an MP3 file in Windows so iPod will accept?

    I posted a problem yesterday, which I was clueless about. Today I know what the problem is, but don't know how to fix it.
    I have 30 MP3 files in a playlist, all from an identical album. I can play every file on my computer through iTunes with no problems. HOWEVER.... my iPod only "recognises" 23 of the 30 files and won't accept the remaining 7.
    I have updated the "info" part of the tags, made it a compilation etc. THat didn't work. THe problem is the the amount of detail in the "properties" section of each file. The 23 that the iPod will accept have many details in the properties section ... eg. artist, title, duration, audio etc etc .. the 7 that will not migrate across only have two details - "type" and "size"...
    SOOO my question is: How do I add to the "properties" of the MP3 files in Windows so the iPod will accept them?
    Would really appreciate some help here, its drivin me nutz!!

    Hi,
    As it didn't work in iTunes, I'm not sure completing the id3 fields for your 7 files through another app will correct the problem. But in any case, one program I use to edit id3 tags is ID3-TagIT. It's freeware.
    http://www.id3-tagit.de/
    Good luck.

  • How do I add leading zero(s) to exported files' names?

    I'm using Lightroom 1.4 on an iMac, with OS X 10.4. When I export a batch of photos, they get numbered automatically. For example, if they're pictures of my dog, I'll specify "Dog" as the name to be used and 1 as the starting number. Lightroom will then export them as "Dog-1.tif" and "Dog-2.tif" and so on.
    The problem is that when I then load these files into another application, it thinks that "Dog -1.tif" should be followed by "Dog-11.tif," then "Dog-12.tif," and so on to "Dog-19.tif" and then "Dog-2.tif," "Dog-20.tif," "Dog-21.tif," etc.
    One solution to this would be to have them numbered as 01, 02, 03. . . 09, 10, 11, etc. Rather than add those leading zeros to the file names manually, I'd like to have Lightroom put them in when it exports the files, but I can't figure out how to do that. I've tried entering 01 as the starting number in the "Export" dialogue box, but that doesn't do the trick.
    Can anybody tell me how to get Lightroom to add a leading zero (or zeros, when I export more than 99 files at a time) to the file names?

    >What if I just wanted to name the images 0001, 0002, 0003, etc? Can't seem to figure that out.
    In the Filename Template Editor, simply insert the [Sequence # (0001)] token as the only entry in the template field.

  • How can I add a line to my CSS file to have all TextArea fields show PRE

    Hi,
    I would like all my TextAreas to show the text as it was inserted into the database... with the new lines, tabs, etc...
    I would like to add a line to my CSS file to do this if possible.
    Thanks, Bill :>)

    Thanks for all the input!
    Fab. You have been talking about a report the whole time... I have been talking about one Database ITEM that is "Displayed as Text".
    In a report the replace() always works in all browsers I believe... and I had no problem.
    BUT, in a text ITEM I wasn't able to get anything to work..
    So, I created a report region and retieved this one column (item) and selected a borderless region and it is fine...
    select     replace(LAST_ACTION,chr(10),'<BR>') "LAST_ACTION"
    from     "HT_ISSUES" "HT_ISSUES"
    where issue_id = :P7_ISSUE_ID
    I still would like to know how to Display as Text - as it is in the DB.
    When have a Dispay as Text Item and I view Source when running the page.. it is correct in the source delivered to the browser but displays all one line.
    (I save a SQL statement to the field)
    [tr>[td  colspan="6" rowspan="6" align="left">[span class="t3NoLabel">Last Action Item[/span> [br>Maintenance Issue - SELECT *
    FROM (SELECT ROWNUM row_num, empno, ename, job, mgr,
    hiredate, sal, comm, deptno
    FROM emp)
    WHERE row_num BETWEEN NVL (:p7_row_from, 1)
    AND NVL (:p7_row_to, 1000000)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How do you add a controller to a SWF file?

    I am a newbie.
    How would I add a controller for play and pause to a SWF
    file? I want to put several SWF files up on a website but want to
    be able to control them. Instead they all play once the web page
    loads.
    Please help.
    Thanks

    > What is need is a %LinksDir% variable.
    I have no client available with links redirected, but basically, this
    should result in a registry value containing the new path. Simply
    regedit and search for your "links" redirection path.
    Then use Item Level targeting "registry value" to store this path in a
    temporary variable that you can use in the target path for your shortcut.
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • How do i add time and date to target file

    hello,
    1. When do we generally go for FCC?
    2. Is it possible to assign field seperator without FCC on the reciever side file adapter?
    3. how do I add timestamp as well as DATE to the target file?
    thnks
    venkat

    Hi venkat
    1. When do we generally go for FCC?
        we can do the FCC at sender side as well as at the receiver side.
        Sender side: we do the FCC at the sender side only if we are getting a flat file   from the sender, and so that it can be understand by the XI,because XI can understand only the XML.
         Receiver side:we do the FCC at the receiver side only if the receiver requires the flat file.
    2. Is it possible to assign field seperator without FCC on the reciever side file adapter?
    no, it is not possible.
    3. how do I add timestamp as well as DATE to the target file?
    if you want to add date and time in the target file for this you have to select the parameter
      File Construction Mode* : AddTimeStamp
    in the processing parameters of the file adapter(Receiver).
    Thanks
    Rinku

  • How do I add text and edit my PDF file?

    how do i add text and edit my pdf file

    Hi pilothorse,
    To edit a PDF file you need to use Acrobat. If you don't have Acrobat, you can try it for free for 30 days. See www.adobe.com/products/acrobat.html for more information.

  • How do i add a download action for dxf files. firefox assumes its a text file and just opens it with no download action dialog box

    I want to add a download action for dxf files so they open in Autodesk trueview. The steps described here (http://support.mozilla.com/en-US/kb/Managing%20file%20types#w_adding-download-actions) say to click on a link for the filetype you want to add an action to but firefox thinks the dxf is a text file and just opens it in a new tab with no download action dialog box.

    Use the right-click context menu and choose "Save Link As" or hold down the alt key and left-click the link.

  • How do I add column headings to an output file?

    Hi,
    I have an internal table that is created in my program and I send that table out as a data file attachment on an email.
    I have a request to include column heading on the data file going out. 
    Does anyone have any ideas as to how I can include a heading line as the first line of the output file?
    I'm an ABAP newbie and I don't know the best way to accomplish this?
    Thanks for your help!
    Andy

    Hi,
    While Building the attachement just add the field description refer following code
    Append header line to download data
      CONCATENATE 'Company Code'(004)
                  'State'(007)
                  'Store'(010)
                  'Tax Type'(013)
                  'Purchase'(015)
                  'Tax Rate'(017)
                  'Gross Tax Due'(021)
                  'Discount'(023)
                  'Net Tax Due'(025)
                  INTO ls_download-data
                  SEPARATED BY lc_tab.
      APPEND ls_download TO gt_download.
      CLEAR : ls_download.
    LOOP AT gt_error_log INTO ls_error_log.
        CONCATENATE ls_error_log-bukrs
                    ls_error_log-budat
                    ls_error_log-monat
                    ls_error_log-gjahr
                    ls_error_log-xblnr
                    ls_error_log-bschl
                    ls_error_log-waers
                    ls_error_log-hkont
                    ls_error_log-wrbtr
                    ls_error_log-prctr
                    ls_error_log-kostl
                    ls_error_log-message
                    INTO ls_attach-line SEPARATED BY lc_tab.
        CONCATENATE lc_cret ls_attach-line  INTO ls_attach-line.
      Append Error log data to attachment Table
        APPEND ls_attach TO lt_objbin.
      ENDLOOP.
    Call the function module to convert the data into Hex
      CALL FUNCTION 'SO_RAW_TO_RTF'
        TABLES
          objcont_old = lt_objbin
          objcont_new = lt_objbin.
    Append converted hex data to attachment table
      LOOP AT lt_objbin INTO lv_line.
        ls_conv = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' endian = 'B').
      Call lmethod to add the data to the output buffer sequentially.
        CALL METHOD ls_conv->write( data = lv_line ).
        lv_buffer = ls_conv->get_buffer( ).
        MOVE lv_buffer TO lv_hexa.
        MOVE lv_hexa TO ls_hex-line.
      Append converted hex data to attachment table
        APPEND ls_hex TO gt_attach.
      ENDLOOP.
    Regards,
    Prashant

  • How can i add a time stamp to tdms file?

    I want the data and the time for the tdms file generated?
    how can i do that?
    should i cinvert .tdms to .lvm and use the data storage option or excel add on option for .lvm file created?
    cant i directly have the time stamp for tdms file generated?

    How are you acquiring the data in the first place?  That will matter in how we want to approach this.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • Cin-exceise-tax

    Issue No.1 Short Text how to prepare PO having discount after excise & tax Long Text hi, Our bussiness requirment is that we want to prepare a PO having discount after excise and tax. Basic Price 32.930 Add Excise Duty 4% 1.320 Add Cess .125% .040 Ad

  • Bridge CC 64 Windows 8.1 not responding

    Installed Bridge CC 64 on a new computer running Windows 8.1. Intel i5 - 4440S 8GB Ram Intel 4400 Graphics Installation went fine. Opens a little slow but what ever you click on, pull-down menus, Computer, Folders I get a "not responding" error at th

  • How to send html file

    I have created an html file that i want to email. I didn't want to email it as an attachment but as the contents of the email(so the recipient opens the email and sees the html file). How do I do this?

  • Error in statement with sql plus

    Hi, I have written this sql statement: SELECT  rtrim('Cambio di: '         || (CASE WHEN nvl(A.DESCRIZIONE_EMITTENTE ,' ') <> nvl(B.DESCRIZIONE_EMITTENTE ,' ') THEN 'Descrizione emittente, ' ELSE '' END)         || (CASE WHEN nvl(A.INDIRIZZO_SEDE_EMI

  • 6210 navigator

    Major help required for this phone. This morning I went to check if I had any messages.NONE! but I now cant use the top 2 buttons on the front of the phone.I also cant use the middle button.I cant get into to check my messages.I can however press the