JavaFx Mobile + Swing Problems

{color:#000000}{color:#ff0000}{color:#003300}The application runs fine when Run As "Desktop(std. execution mode)" & when changed to Run In "Mobile Emulator" gives following Error :-->{color}
{color}{color}{color:#ff0000}Error preverifying class javafx.ext.swing.JTextFieldImpl
java/lang/NoClassDefFoundError: com/sun/javafx/scene/BackgroundSupport$BackgroundSupportable
ERROR: preverify execution failed, exit code: 1
{color}{color:#000000}{color:#0000ff}C:\Documents and Settings\pravin.patil\My Documents\NetBeansProjects\ColorSlider\nbproject\build-impl.xml:143: exec returned: -1
{color}{color:#ff0000}BUILD FAILED (total time: 8 seconds){color}
How to use Swing components in JavaFX Mobile apps??
Thanks & Regards,
Pravin{color}
Edited by: pravinpatil23 on Mar 30, 2009 3:40 AM

You can provide visual feedback of clicking.
Here is a primitive (crude!), naive native button, as an example of such effect. I wanted to make it look like it was physically pressed.
public class NativeButton extends CustomNode
  var arcSize: Number;
  var message: String;
  var width: Number;
  var height: Number;
  var hole: Rectangle;
  public var displacement: Number;
  override protected function create(): Node
    arcSize = height / 5.0;
    displacement = 3;
    hole = Rectangle
      x: 0, y: 0
      width: width
      height: height
      arcWidth: arcSize,  arcHeight: arcSize
      fill: Color.BLACK
    clip = hole;
    Group
      content:
        hole
        Rectangle
          x: 0, y: 0
          width: width
          height: height
          arcWidth: arcSize,  arcHeight: arcSize
          fill: LinearGradient
            startX: 0.0, startY: 0.0, endX: 1.0, endY: 1.0
            proportional: true
            stops:
              Stop { offset: 0.0, color: Color.LIGHTBLUE }
              Stop { offset: 1.0, color: Color.BLUE }
          onMousePressed: ShowPressed
          onMouseReleased: ShowReleased
        Rectangle
          x: height / 9.0, y: height / 9.0
          width: width - 2 * height / 9.0
          height: height * 7 / 9.0
          arcWidth: arcSize,  arcHeight: arcSize
          fill: LinearGradient
            startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
            proportional: true
            stops:
              Stop { offset: 0.0, color: Color.LIGHTBLUE }
              Stop { offset: 1.0, color: Color.BLUE }
        Text
          x: width / 7, y: height / 1.4
          content: message
          fill: Color.YELLOW
          font: Font.font(null, FontWeight.BOLD, 36);
  function ShowPressed(e: MouseEvent): Void
    this.translateX = this.translateY = displacement;
    hole.translateX = hole.translateY = -displacement;
//~     println("Clicked {this}");
  function ShowReleased(e: MouseEvent): Void
    this.translateX = this.translateY = 0;
    hole.translateX = hole.translateY = 0;
//~     println("Released");
function run()
def BASE_SIZE = 300;
Stage
  title: "Native JavaFX Button"
  scene: Scene
    width:  BASE_SIZE
    height: BASE_SIZE
    fill:   Color.web('#00BABE')
    content:
      Group
        translateX: 20
        translateY: 20
        content:
          NativeButton { message: "Click Me", width: 200, height: 50 }
}You can add effects, do something on hovering, etc.

Similar Messages

  • Is it too early to start with JavaFX Mobile Development ?

    There are no developer compnents except "TextBox"
    The only samples i can see are "showing Photos in grid like structure & similar kinds of app" :(
    it doesn't even support Swing
    What developer wants "Data Entry Form" which user will submit data to Server Or Store data To Database & then Process the Data & return Result to user, Etc & much more req
    why javaFx is more Media Oriented( Audio, Video,Graphics,Animation,Games,etc)
    What benifits it provides to Developer.I am basically targetting JavaFX Mobile
    Please Reply to help me understand What Can I do In JavaFx mobile domain
    Thanks & Regards,
    Pravin

    Hello, and Welcome to the HP Support Community! As with any Internet Forum, you have to realize that you are visiting a "hospital" - most folks here are the minority who have had problems. If one was to judge the human race by visiting a hospital, you might run outside screaming "WE'RE ALL DOOMED!  EVERYONE HERE IS SICK!!!"   Those who have no issues at all do not come here and check in.  The few that actually do come by and offer compliments are far and few between, and they are greatly appreciated by us! I've asked HP about Win10.  They will not provide an answer until the final release is out.  It could run with zero issues, or not! The Sprout is an amazing device - a large touchscreen All In One computer with some cool options not many other PC's could ever do! Is it too early?  I've had one for almost a year (a loaner from HP for my participation here).  Glitches?  A few that were easily remedied.  The decision is up to you.  If worried about Win10, then wait a month or two.  The device runs fine on Win 8.1.  Why change to Win10? WyreNut

  • Variable binding with javafx.ext.swing.SwingSlider

    My first javafx program consists of a slider and a text box, the text box displays the current value of the slider. The problem is the text box does not display anything when the program just starts up, but only gets populated once I change the value of the slider. I am not sure what I am doing wrong. Here is the code:
    import javafx.scene.control.*;
    import javafx.scene.*;
    import javafx.stage.*;
    import  javafx.ext.swing.*;
    import javafx.scene.layout.*;
    var BPMSlider = SwingSlider {
        minimum: 10
        maximum: 250
        value: 60
    }; //BPMSlider
    var BPM = bind "{BPMSlider.value}";
    var BPMDisplay = TextBox {
         text: bind BPM
        columns: 3
    }; //BPMDisplay;
    Stage  {
        title: "Slider";
        width: 1000
        height: 500
        visible: true
       // Set the scene
       scene:
           Scene {
           content:       
               HBox{ spacing: 10 content:[ BPMSlider, BPMDisplay ] }
           } // Scene
    }Thanks!

    Hi,
    I don't know how to solve it with binding values, but I managed to solve it with temporary int value which contains Slider.value.
    If any one can help us with solving this binding value we are waiting for answer.
    Here is the code:
    package slider;
    import javafx.ext.swing.*;
    import javafx.scene.*;
    import javafx.scene.control.*;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.*;
    import javafx.stage.*;
    var tempSliderVal:Integer = 60; // temp BPMSlider value
    var BPMSlider = SwingSlider {
        minimum: 10;
        maximum: 250;
        value: bind tempSliderVal with inverse;
        onMouseDragged: function (e:MouseEvent) {
            BPMDisplay.text = tempSliderVal.toString();
        onMouseClicked: function (e:MouseEvent) {
            BPMDisplay.text = tempSliderVal.toString();
    }; //BPMSlider
    var BPMDisplay = TextBox {
         text: tempSliderVal.toString();
        columns: 3;
    }; //BPMDisplay;
    Stage  {
        title: "Slider";
        width: 1000;
        height: 500;
        visible: true;
        // Set the scene
        scene: Scene {
            content: HBox{
                spacing: 10;
                content:[ BPMSlider, BPMDisplay ];
        } // Scene
    }

  • JavaFX - Image preloading problem

    Hi,
    I try to use ImageView and face some problems with image preloading.
    Here is the code related to the component that has problems. The component extends CustomNode.
    in class attributes declaration:
    var imgNodes: ImageView[];
    // list of url of images to display
    public-init var imgs: String[];
    in create function:
    for(indice in [0..batch]){
    var view= ImageView{
    fitWidth:100
    fitHeight:100
    translateX: (110 * indice)
    preserveRatio: true
    cursor: Cursor.HAND
    insert view into imgNodes;
    on an image loading function:
    for(indice in [0..batch]){
    imgNodes[indice].image = Image{
    width: 100
    height: 100
    url: imgs[firstItem+indice]
    preserveRatio: true
    backgroundLoading: true
    with backgroundLoading set to true, the images are not displayed. When setting it to false, the images appear. So the urls passed to Image are ok.
    If I display the fields error and progress of the Image components, both have the value 0.
    I have other components that use preloading and they are working great before showing the problematic component. After, preloading does not work anymore.
    It looks like as if the thread used to preload images is blocked.
    Can anyone help me with it?
    Thanks in advance for your help
    Thomas

    I'm not shure but i think the only group component wich is updated after insert or delete is a Group, so there is the same problem with V/HBox.
    Then this code work for me
    package forumsamples;
    import javafx.ext.swing.SwingButton;
    import javafx.lang.FX;
    import javafx.scene.Cursor;
    import javafx.scene.Group;
    import javafx.scene.image.Image;
    import javafx.scene.image.ImageView;
    import javafx.scene.layout.VBox;
    import javafx.scene.Scene;
    import javafx.stage.Stage;
    * @author Alex
    var imgNodes: Group;
    // list of url of images to display
    var imgs: String[] =
    for (n in [1..3]) "file:///E:/dev/images/FA/OUI/{n}.bmp";
    //in create function:
    //on an image loading function:
    function load() {
        for(indice in [0..3]){
            insert ImageView {
                fitWidth:100
                fitHeight:100
                translateX: (110 * indice)
                preserveRatio: true
                cursor: Cursor.HAND
                image: Image{
                    width: 100
                    height: 100
                    url: imgs[indice]
                    preserveRatio: true
                    backgroundLoading: true
            } into imgNodes.content;
    Stage {
        title : ""
        scene: Scene {
            width: 200
            height: 200
            content: [
                VBox {
                    content: [
                        SwingButton {
                            text: "Button"
                            action: function() {
                                load();
                        imgNodes = Group { }
    }

  • JavaFX Mobile refuses to run my apps

    I am currently trying to familiarize myself with the JavaFX platform, especially the mobile aspects. I am having trouble with the JavaFX Mobile runtime.
    I am unable to run any apps of my own. I am using the newest NetBeans environment to compile everything and create the jar/jad package. I am able to upload the package to my mobile device, install it without any error, and see it listed in the app list of the JavaFX launcher. However, when I attempt to launch my apps, it appears to be starting normally but nothing ever shows up except the "exit" menu item. I get no errors of any kind, just nada.
    Thinking that I was doing something wrong due to my inexperience with the new scripting language, I downloaded some apps from javafx.com and tried those. They don't work either. However, the four apps that come pre-installed with JavaFX mobile (calculator, tweeter, etc) all work fine. Things I compile with NetBeans work just fine in the emulator, but not on my device in real life.
    Can anyone let me know what is going on? Is there an error log somewhere that I can look at? Thanks for any help.
    Mobile Device: HTC Touch Pro 2
    OS: Windows Mobile 6.1 Professional
    NetBeans: 6.7.1 with all updates
    JavaFX: 1.2 EA2, SJWC 2.2
    -d
    Edited by: metalliqaz on Dec 9, 2009 8:39 AM

    I tested newly released "JavaFX Mobile 1.2 for Windows Mobile" from javafx.com on HTC Diamond together with NetBeans 6.8 with all necessary updates and everything works fine. I believe it should work also on your HTC Touch Pro 2. The problem might be caused by using JavaFX early access, please try with reference release (released last week).
    You can enable logging via Remote Registry Editor or whatever registry editor on windows mobile by setting HKEY_LOCAL_MACHINE\Software\SUN\JVM\LoggingAllowed to value 3.
    Then the log file containing text output is \\\JavaFX\Java\java.txt

  • How to install/deploy JavaFx Mobile application on real mobile devices.

    Hi,
    I had gone through the internet and various links but i'm unable to find the solution regarding how to deploy the application made with JavaFx mobile on real mobile devices. There was some link in which it was written you can install the application in Nokia 40 5edition phone, i tried to install in Nokia 6600 Slider through bluetooth; so while installing the application it shows an error as "Invalid Application".
    I'm also facing same problem which others are also facing as Application is not compatible when i tried to install in Nokia N95.
    So, if anybody knows the method/technique to deploy the application in real mobile devices i'll be grateful to him.
    Thanks
    Gaurav

    Thanks Michael for the reply. I also tried to install one simple application made with JavaFx Mobile in Sony-Ericsson JP-8 platform(K850i, W910i). While installing the application it pop-up the error "Operation Failed".
    So, is there any way to install the application in current available mobile devices in the market or not??
    @ Sun People please help me in this.
    Thanks
    Gaurav

  • JavaFX mobile execution

    whenever I ran an application in mobile emulator(by selexting run in mobile emulator), I get the following error message
    init:
    deps-jar:
    WARNING: following file/directory does not exist: C:\Users\ramakant\Documents\NetBeansProjects\Testing
    ApplicationMapper: 90 packages, 98 classes visited
    Error preverifying class testing.Main
        VERIFIER ERROR testing/Main.<clinit>()V:
    Cannot find class javafx/scene/effect/Reflection$Intf
    ERROR: preverify execution failed, exit code: 1
    C:\Users\ramakant\Documents\NetBeansProjects\Testing\nbproject\build-impl.xml:143: exec returned: -1
    BUILD FAILED (total time: 2 seconds)in the netbeans output window, I searched the net about it but with no luck, I just reisntalled the application because autoformat option is not working, now that problem is secondary , first I want to fix this execution problem, the programs are running fine in standard execution mode, and I am trying to run this application [http://learnjavafx.typepad.com/weblog/2009/02/a-simple-binding-example-in-javafx-mobile.html|http://learnjavafx.typepad.com/weblog/2009/02/a-simple-binding-example-in-javafx-mobile.html]

    it certainly was not the problem but it helped me to enable execution, I was running a file in mobile platform while the package has desktop profile classes also, your tip helped execution but I still get this warning,
    WARNING: following file/directory does not exist: C:\Users\ramakant\Desktop\JavaGame\Imagix\Mobile
    ApplicationMapper: 3 packages, 3 classes visited
    WARNING: following file/directory does not exist: C:\Users\ramakant\Desktop\JavaGame\Imagix\Mobile
    compile:Can you help me how to remove this warning

  • Newbie qs. JavaFx vs Swing?

    I looked through the JavaFx introduction and samples, but wish there could be clarification of the following which other developers too might wonder about:
    Should I write my app in Swing or Java Fx - what considerations should guide my choice?
    It seems that Fx is an alternative or competitor to applets or Google Web toolkit or Flash.
    Can you access the file system, work offline?
    thanks,
    Anil

    Yes you're right in that there are many considerations that involved in choosing between JavaFX or Swing (or some other technology) and for the most part a lot of it is just going to come down to opinions rather than hard and fast rules.
    First of all, JavaFX applications whether they are deployed as Applets, via Web Start, or with a standalone installer can access the file system, work offline, open sockets etc. The restriction is that if deployed as an Applet or via Web Start the application has to be "signed" and the user has to accept the signed application (click "Yes" on a security warning).
    Having said that even unsigned Applets/WebStart applications do have limited access to the file system (a private sandbox) and can open connections back to their originating server. Applets used to be restricted to running in the browser but now they can be dragged out of the browser and "installed" with a shortcut on the users system. The following link provides a good starting point for more information
    [http://java.sun.com/javase/6/docs/technotes/guides/jweb/index.html]
    Always remember that JavaFX sits on top of Java and often leverages tools, products and technologies to achieve tasks.
    In terms of Swing vs JavaFX some of the things you might want to consider are:
    Tolerance towards new technologies. Is you organisation able to take something "cutting-edge" and is prepared to work around problems or limitations. Or are the stakeholders in the project so risk-adverse that a more mainstream approach would be better.
    Willingness to write code. At this stage you will find that Swing has far more components (widgets) available to it, you can somewhat easily reuse Swing components within JavaFX application but you will need to write and maintain extra code to do so. Also there are other gaps in JavaFX where you'll probably need to write extra code like serialization or dealing with medium-complex event handling (action frameworks). More code appears to have more cost but sometimes you also get the benefit of a better fit to your problem.
    But then on the other hand JavaFX is a language dedicated to writing GUIs so you can also argue that even with the current relative immaturity having support within the language for "bind" will result in less code than the the same application written in Swing.
    What's the lifespan of this project for you organisation? A short-term one-off project might justify the use of JavaFX through it being not strategic to your organisation. But then on the other hand a large long-term project might also justify the use of JavaFX because it's easier to absorb specialists filling in the gaps of JavaFX in a larger team and also you might see how JavaFX is going to be important into the future (obviously a value based opinion).
    What level of "graphics" do you want? The Scene graph within JavaFX makes doing "fancy" graphics, video and animation easier than in Swing.
    Hope this helps.
    - Richard.

  • When i try to activate iMessage i could see the comment "waiting for activation" for more than 24hrs.Is this because of mobile device problem or someother issue ? My mobile is just 20 days old

    When i try to activate iMessage i could see the comment "waiting for activation" for more than 24hrs.
    Is this because of mobile device problem or someother issue ?
    My mobile is just 20 days old

    The following discusses that error message and may help: iOS: Troubleshooting FaceTime and iMessage activation

  • Import javafx.ext.swing.SwingToggleGroup not found in the classpath

    I am trying to run the example here
    Desktop profile
    http://java.sun.com/javafx/1/tutorials/ui/layout/index.html
    but
    import javafx.ext.swing.SwingToggleGroup;
    import javafx.ext.swing.SwingRadioButton;
    here i am having error because
    javafx.ext is not found in my classpath, I am using Netbeans 6.5

    While this shouldn't cause that error, your post is missing a final curly bracket.
    Adding that, it compiles ok in Windows.

  • LinearGradient doesn't appear in JavaFX mobile application

    Hi everyone.
    I'm developing a JavaFX mobile application. The scenes will have a Gradient of black and green background color.
    Here is the code.
    var scene1 : Scene = Scene{
            fill: LinearGradient {
            startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
            proportional: true
            stops: [ Stop { offset: 0.0 color: Color.BLACK },
                     Stop { offset: 1.0 color: Color.GREEN } ]
            contentAccording to JavaFX API, LinearGradient is found in common profile. Which means I should be able to use it in my mobile application. But when deploying it into an actual mobile phone, the scene's background is plain white.
    Why doesn't it take effect??
    When running the application into a mobile emulator, it is just fine.

    >
    When running the application into a mobile emulator, it is just fine.
    I think there was a bug in LinearGradient + proportional. Is it using latest JavaFX runtime on phone?
    Just to confirm this, can you specify absolute coordinates (with proportional: false) for LinearGradient?
    I faced this issue long time back while implementing background of InterestingPhotos, but now it works fine.
    http://javafx.com/samples/InterestingPhotos/src/Background.fx.html

  • Help! swing problem

    i keep getting the error: boxlayout can't be shared...
    what's the problem?
    Part of My code:
    JPanel CatSubPanel = new JPanel() {
                public Dimension getMinimumSize() {
                    return getPreferredSize();
                public Dimension getPreferredSize() {
                    return new Dimension(400, super.getPreferredSize().height);
                public Dimension getMaximumSize() {
                    return getPreferredSize();
    CatSubPanel.setLayout(new BoxLayout(CatSubPanel, BoxLayout.X_AXIS));
    if (MULTICOLORED) {
                CatSubPanel.setOpaque(true);
                CatSubPanel.setBackground(new Color(0, 0, 255));
            CatSubPanel.setBorder(BorderFactory.createEmptyBorder(0,1,10,5));
          CatSubPanel.add(anotherNewPanel);

    help! swing problemI don't think so.
    I just mentioned there is a Swing forum for posting Swing related questions.
    I also gave you a link to a tutorial on How to Use Box Layout.

  • [b]the swing problem!,help me[/b]

    the code:
    JScrollPane p = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,                    JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    ImageIcon icon = new ImageIcon(getClass().getResource("images/275.tif"));
    JLabel l = new JLabel(icon);
    p.setViewportView(l);
    this.getContentPane().add(p);
    this.pack();
    this.setSize(300,300);
    this.setVisible(true);
    question: I con't see the picture ,why? is the .tif format problem

    the swing problem!,help meIf you know its a Swing problem then you should be posting in the "Swing forum".
    You said it works for .jpg images, so the JDK may not support .tif images.

  • Deploying JavaFX mobile app on SkyDrive

    Hello,
    I am trying to test a JavaFX mobile app on my phone: LG600G. The phone's CLDC is 1.1 and the MIDP is 2.0, so it can run Java Midlets. Unfortunately, I can't send the .jad file or jnlp file to it across Bluetooth and choose the "install" option. The option isn't available, so I am trying to deploy store the .jad .jnlp and .jar files on my Windows SkyDrive. I can't figure out how to do it correctly though. Could someone tell me what I should point my phone's browser to? Should I point it to the .jnlp file or the jad file? Also, how do I set the codebase of the jnlp file? If it helps, here is [my account:|http://cid-df734c62403d114d.skydrive.live.com/browse.aspx/.Public]
    If someone has done this before, and you have a link to some tutorial, I could use that too!
    Thank-you,
    Vance

    This phone doesn't seem to be powered by Windows Mobile, so JavaFX won't work on it.
    See the answer in [as of 2010, what mobile phones support JavaFX?|http://forums.sun.com/thread.jspa?threadID=5432053] thread.

  • Anyone interested in adf swing problems

    adf 11g R1 swing problem
    I test the new JDEV 11g 11.1.1.1.0 releas Juli 01
    I'm using the JClient (Swing) with ADF (BC4J)
    and test a simple app
    JTable with Combobox don't work:
    im set the binding with edit binding in context for JTable
    the combobox has a static viewobject with ID and Text (ID 0,1 Text Yes No)
    The Table with combobox render OK
    but when Click the combobox i see no values in the Combobox
    in Previous Release 11.1.1.0.2 work the sample.
    It this a Bug in Classe from the bindig Definition file pageDef ????
    RTClass="oracle.jbo.uicli.jui.JULOVEditorPropDef"
    DTClass="oracle.adfdtinternal.model.ide.objects.jui.JUDTLOVEditorProp"
    Hello,
    this Bug is not fixed in 11.1.1.2.0
    why ????
    thank you in advance
    Michael
    Edited by: user4796211 on 21.07.2009 12:18
    Edited by: user4796211 on 22.07.2009 00:59
    Edited by: user4796211 on 24.07.2009 09:54
    Edited by: user4796211 on 27.07.2009 09:59
    Edited by: user4796211 on 16.11.2009 10:56

    Hi,
    I installed JDeveloper 11.1.1.3.0 and cracked the nut. The LOV driven ComboBoxes in JTables will remain empty after migrating to the new version, but it seems to be merely a bug in the migration. What you need to do in order to get the ComboBoxes working is the following:
    I found out that in your PageDefs you need to add two attributes to the <combobox> definitions:
    ControlClass="javax.swing.JComboBox" Editable="false"
    This makes the ComboBoxes look like in previous releases. If you skip the "Editable" attribute, the user can type in values, which does not really work in LOVs but in static lists.
    Unfortunately I experienced another bug in the 11.1.1.3.0 release concerning LOVs: When defining the LOV in the ViewDef, JDeveloper wouldn't let you specify any additional columns to be displayed in the LOV ("Display Attributes"). -> The workaround is much easier than I first thought: Just resize the dialog a little bigger and the selection fields that I first missed appear!
    In the moment it looks to me like I could continue development with JDeveloper 11.1.1.3.0.
    Mathias
    Edited by: user7585671 on 05.05.2010 06:26

Maybe you are looking for

  • Where we have to create depreciation key in asset accounting for as02 ?

    Hi all where we have to create depreciation key in asset accounting for as02 ? Regards Saimedha

  • ITunes 9.0.1 not burning CDs

    I recently downloaded iTunes 9.0.1 and every time I open it, it displays n error saying that the registry for importing and burning CDs is missing, it imports fine, but it wont burn. I've been using 4x speed as this is the fastest setting the CD (Son

  • BB Curve 9380 not working

    I need your help. I had purchased blackberry 9380  on 15th July 2012. Ever since I bought it, the hand set has a problem that it most of the time shows SOS for network and even if it shows the connectivity, the calls get drops with in 30-60 seconds.

  • N97 Homescreen Error - "already in use" but not ac...

    Yesterday my N97 switched itself off and when it came on it would only show the menu screen and not the homescreen. If I try to access the homescreen it tells me "its already in use" and keeps diverting back to the menu screen. All applications are w

  • Inserting a Sequence of Numbers

    Hi all I have a number field restricted to 3 digits, and when someone navigates to the block to insert a record I want the number field to display 001 to state this is the first record, then if a second record is inserted put in 002 etc. Currently yo