java-forum.org
JBoss Seam
Alter Preis: 39,95 €
Jetzt: 0,00 €

zzgl. Versandkosten

Zurück   java-forum.org > Java - Programmierung > Mobile Geräte

Mobile Geräte J2ME, Android

Antwort    
Themen-Optionen Thema durchsuchen Ansicht
Alt 07.02.2010, 15:37   #1 (permalink)
Neuer Benutzer
Byte
 
Registriert seit: 07.02.2010
Beiträge: 11
Abgegebene Danke: 0
Erhielt 0 Danke für 0 Beiträge
Standard Run Xlet on a mobile device

Hallo,

ich hab folgendes Problem:
Ich habe mit Netbeans eine CDC Anwendung geschrieben. Mit dem Emulator läuft die Testanwendung auch.
Jedoch wenn ich es "deploye" und die .jar Datei auf meinem Handy (HTC Touch HD) auszuführen kommt die Meldung das der Midletname fehlt. Das ist seltsam, da es ja ein Xlet ist.

Kann mir jemand sagen was ich machen muss, damit das Xlet auf meinem Handy läuft?

Danke Schön

Grüße

Mathias

Code:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


package cdcapplication1;


import java.awt.Container;
import java.awt.EventQueue;
import javax.microedition.xlet.UnavailableContainerException;
import javax.microedition.xlet.XletContext;
import javax.microedition.xlet.XletStateChangeException;

/**
 * @author XPMUser
 */
public class NewAGUIXlet extends javax.swing.JInternalFrame implements javax.microedition.xlet.Xlet {
    
    private XletContext context;            // our Xlet application context.
    private Container rootContainer;        // the root container of our screen.

    
    /** Creates new form NewAGUIXlet */
    public NewAGUIXlet() {
        initComponents();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jButton1 = new javax.swing.JButton();

        jButton1.setText("jButton1");

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap(103, Short.MAX_VALUE)
                .add(jButton1)
                .add(76, 76, 76))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(66, 66, 66)
                .add(jButton1)
                .addContainerGap(197, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>
    
    
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    // End of variables declaration

    public void initXlet(final XletContext xletContext) throws XletStateChangeException {
        context = xletContext; 
        if(rootContainer == null) {
            try {
                    //This call to getContainer() tells the OS we want to be a graphical app.
                    rootContainer = context.getContainer();
            } catch (UnavailableContainerException e) {
                    System.out.println("Ouch ! could not get our container!");
                    // If we can't get the root container,
                    // abort the initialization
                    throw new XletStateChangeException( "Start aborted -- no container: "
                                                        + e.getMessage() );
            }
        }        
    }

    public void startXlet() throws XletStateChangeException {
        // Note: Swing thread constraints still apply in an Xlet... most operations
        // need to be on the event thread, and this invokeLater does that.
        try {
            // using invokeAndWait to avoid writing synchornization code.
            // invokeLater would work just as well in most cases.
            EventQueue.invokeAndWait(new Runnable() {
                public void run() {
                    NewAGUIXlet.this.setVisible(true);
                    rootContainer.add(NewAGUIXlet.this);
                    // This is needed - or nothing will be displayed.
                    rootContainer.setVisible(true);
                }
            });
        } catch (Exception e) {
            System.out.println("Ouch - exception in invokeAndWait()");
            e.printStackTrace();
            exit();
        }
    }

    public void pauseXlet() {
        //This is pure overkill for this application, but is done to demonstrate the point.
        //We are freeing up our only resources (the screen), and we will rebuild it when
        //we get started again. If you took out this block - the application should still
        //run perfectly, and the screen should only be created once.
        try {
                // using invokeAndWait to avoid writing synchornization code.
                // invokeLater would work just as well in most cases.
                EventQueue.invokeAndWait(new Runnable() {
                        public void run() {
                            rootContainer.remove(NewAGUIXlet.this);
                        }
                });
        } catch (Exception e) {
                System.out.println("Ouch - exception in invokeAndWait()");
                e.printStackTrace();
                exit();
        }
    }

    public void destroyXlet(boolean b) throws XletStateChangeException {
        System.out.println("HelloXet.destroylet() - goodbye");
    }

    public void exit(){
        rootContainer.setVisible( false );
        context.notifyDestroyed();
    }    
}
mkant ist offline  
Bei Google nach dem markiertem Wort suchen Bei Wikipedia nach dem markiertem Wort suchen Im Forum nach dem markiertem Wort suchen
Mit Zitat antworten
Antwort    

Lesezeichen

Latex Maths & Physics Editor ...

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln
Es ist Ihnen erlaubt, neue Themen zu verfassen.
Es ist Ihnen erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are aus
Pingbacks are aus
Refbacks are aus


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
ConcurrentModificationException nicht nachvollziehbar DrLoad Allgemeine Java-Themen 8 30.09.2009 16:40
Problem mit Midi und Device Auswahl ubbut Allgemeine Java-Themen 0 17.08.2009 19:11
upnp Device-Discovery im Netzwerk Mufasa Netzwerkprogrammierung 5 27.07.2009 15:23
Java Mobile SDK 3 - Can't Connect to Device Manager The_S Mobile Geräte 14 20.07.2009 13:00
Eclipse: Run configuration - run a product IDEs und Tools 1 18.02.2007 12:51


Alle Zeitangaben in WEZ +2. Es ist jetzt 07:25 Uhr.


Powered by vBulletin® Version 3.8.6 (Deutsch)
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Thanks for Smilies by smilies.4-user.de