[cdc] Re: [nbusers] Re: develop CDC app and run on a SavaJe phone

  • From: Martin Ryzl < >
  • To: Ove Nordstrom < >,
  • Subject: [cdc] Re: [nbusers] Re: develop CDC app and run on a SavaJe phone
  • Date: Wed, 24 May 2006 17:09:16 +0200
  • Mailing-list: contact ; run by ezmlm

Yep, feel free to use it.
Going back I'd suggest the same - probably the best way would be to
create initialization methods for all screens and something like
setCurrent() that would handle the switching.
BTW, you are not the first person asking for flow - seems people really
like MIDP visual designer :).

-Martin

Ove Nordstrom wrote:

Hi,
Is there a mailing list called: 

 ?

When go back to the first side, what is the best way?
-ove

-----Original Message-----
From: [mailto: ] Sent: den 24 maj 2006 16:21
To: Ove Nordstrom; 

Subject: Re: [nbusers] Re: develop CDC app and run on a SavaJe phone

No support for flow at the moment. The best way is to create another
class (JPanel) and implement simple switching based on
rootContainer.remove() and rootContainer.add()

I'm adding mobility-cdc@ since it may be interesting for other
developers as well.

-Martin

Ove Nordstrom wrote:


Hi,
A question:
Hi,
I have a question.
I have created a AGUI app. and added a Jmeny with JmenuItem's I have also created JPanel (PlayersJPanel) that would like to open in "
playersJMenuItemActionPerformed"
What is the best way to do that in Netbeans mobility CDC?
Support for that in the GUI design?
-ove

private void playersJMenuItemActionPerformed(java.awt.event.ActionEvent

evt)

{ // TODO add your handling code here:
}

-----Original Message-----
From: [mailto: ] Sent: den 24 maj 2006 15:48
To: Ove Nordstrom
Subject: Re: [nbusers] Re: develop CDC app and run on a SavaJe phone

Yeah, that's the workaround, but it should have already been fixed.

-Martin

Ove Nordstrom wrote:


Hi,
I added this to build.xml,so it works now:
<target name="-post-jar">
      <jar update="true" destfile="${dist.jar}">
          <zipfileset src="${libs.swing-layout.classpath}"/>
      </jar>
</target>

-ove

-----Original Message-----
From: [mailto: ] Sent: den 24 maj 2006 15:40
To: Ove Nordstrom
Subject: Re: [nbusers] Re: develop CDC app and run on a SavaJe phone

Go to download page, force reload to make sure it is not cached
and download the latest one. I'm sorry for that - the whole SavaJe
support was added just before JavaOne and the bug was reported during
the show. We'll be producing regular builds soon and as far as I know
the device itself is still rather developer version so expect it will
be getting more and more stable.

-Martin

Ove Nordstrom wrote:



Hi,
I have this version: netbeans-mobility-cdc-5.5-preview-win.exe
-ove
-----Original Message-----
From: [mailto: ] Sent: den 24 maj 2006 15:18
To: 

Subject: [nbusers] Re: develop CDC app and run on a SavaJe phone

Make sure you have really the latest version:
netbeans-mobility-cdc-5.5u1-preview-win.exe

If the problem persists, please report a bug and attach more
details - list of files in {project}/target dir and content of
bundle.jnlp.

-Martin

Ove Nordstrom wrote:





Hi,

I have develop a very simple app using NetBeans Mobility Pack for CDC

(http://www.netbeans.org/kb/50/mobilitycdc.html) and Sun Java Toolkit for CDC, Early Access (http://java.sun.com/products/cdctoolkit/download-1_0-ea.html).

As GUI toolkit I have used AGUI (JSR-209).

I run it on my PC and it works.

I deploy it on my savaje phone, I see the app., but when try to start it, nothing happen.

What is wrong?

-Ove



********************** Main.java****************************************

/*

* Main.java

*

* Created on den 23 maj 2006, 16:38

*

* To change this template, choose Tools | Template Manager

* and open the template in the editor.

*/



package hello_cdc;



import java.awt.Container;

import java.awt.EventQueue;

import javax.microedition.xlet.UnavailableContainerException;

import javax.microedition.xlet.XletContext;

import javax.microedition.xlet.XletStateChangeException;



/**

*

* @author ove

*/

public class Main 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 Main */

public Main() {

    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(97, Short.MAX_VALUE)

            .add(jButton1)

            .add(76, 76, 76))

    );

    layout.setVerticalGroup(

layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)

        .add(layout.createSequentialGroup()

            .add(91, 91, 91)

            .add(jButton1)

            .addContainerGap(170, 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() {

                Main.this.setVisible(true);

                rootContainer.add(Main.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(Main.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();

}

}








--
_______________________________________________________
Martin Ryzl 
< >
Sun Microsystems, Inc., Prague (GMT+1)
Phone: +420 233 009 130 (x49130), Fax: +420 233 009 299





[cdc] Re: [nbusers] Re: develop CDC app and run on a SavaJe phone

Martin Ryzl 05/24/2006

<Possible follow-up(s)>

[cdc] Re: [nbusers] Re: develop CDC app and run on a SavaJe phone

Martin Ryzl 05/24/2006

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close