Illegal Argument exception in Swing

I wrote a Swing program. When I start it there is an Argument exception non-compliant with the message "comparison method violates the general contract.

But the battery of my code is in there - it's entirely about the AWT event queue (see copy of stack below). And there is no comparison at all in my program.

The program seems to run OK, but it's more than a little disconcerting. Everyone here you have any ideas what's wrong inside Swing?

Thanks in advance,

Peter

Output of stack is:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: comparison method violates the general contract!
at java.util.TimSort.mergeLo(TimSort.java:747)
at java.util.TimSort.mergeAt(TimSort.java:483)
at java.util.TimSort.mergeCollapse(TimSort.java:410)
at java.util.TimSort.sort(TimSort.java:214)
at java.util.TimSort.sort(TimSort.java:173)
at java.util.Arrays.sort(Arrays.java:659)
at java.util.Collections.sort(Collections.java:217)
at javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(SortingFocusTraversalPolicy.java:136)
at javax.swing.SortingFocusTraversalPolicy.getFocusTraversalCycle(SortingFocusTraversalPolicy.java:110)
at javax.swing.SortingFocusTraversalPolicy.getFirstComponent(SortingFocusTraversalPolicy.java:435)
at javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(LayoutFocusTraversalPolicy.java:166)
at javax.swing.SortingFocusTraversalPolicy.getDefaultComponent(SortingFocusTraversalPolicy.java:515)
at java.awt.FocusTraversalPolicy.getInitialComponent(FocusTraversalPolicy.java:169)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:380)
at java.awt.Component.dispatchEventImpl(Component.java:4731)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
at $200 (EventQueue.java:103) java.awt.EventQueue.access
in java.awt.EventQueue$ 3.run(EventQueue.java:682)
in java.awt.EventQueue$ 3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged (Native Method)
in java.security.ProtectionDomain$ 1.doIntersectionPrivilege(ProtectionDomain.java:76)
in java.security.ProtectionDomain$ 1.doIntersectionPrivilege(ProtectionDomain.java:87)
in java.awt.EventQueue$ 4.run(EventQueue.java:696)
in java.awt.EventQueue$ 4.run(EventQueue.java:694)
at java.security.AccessController.doPrivileged (Native Method)
in java.security.ProtectionDomain$ 1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
at java.awt.SequencedEvent.dispatch(SequencedEvent.java:116)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
at $200 (EventQueue.java:103) java.awt.EventQueue.access
in java.awt.EventQueue$ 3.run(EventQueue.java:682)
in java.awt.EventQueue$ 3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged (Native Method)
in java.security.ProtectionDomain$ 1.doIntersectionPrivilege(ProtectionDomain.java:76)
in java.security.ProtectionDomain$ 1.doIntersectionPrivilege(ProtectionDomain.java:87)
in java.awt.EventQueue$ 4.run(EventQueue.java:696)
in java.awt.EventQueue$ 4.run(EventQueue.java:694)
at java.security.AccessController.doPrivileged (Native Method)
in java.security.ProtectionDomain$ 1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

ptoye wrote:
Yes, but what is the syntax of the string of the property? I tried to 'true', 'TRUE', 'Boolean.true', 'Boolean.TRUE', 'optional boolean. REAL"and other combinations of upper and lower case. And the sun.security.action package is not in the published Javadoc is not easy to know what he wants.

The value correct woud be 'true', such as recommended by doremifasollatido. But given that the property is accessed from a static context, it must be paid before the class of berries is responsible.

I guess you can try to set in a static initializer in your class that has a method hand (...) and see if it takes. If not, you're left with the line of command as the only option argument.

DB

Tags: Java

Similar Questions

  • JVM 104 - Illegal Argument Exception (wait, what?)

    Friends and enemies,

    I am the developer of a BlackBerry app that works very well for over a year.  All of a sudden, I'm going to run the Simulator, and I get an exception error Uncaght JVM (not on the launch, but medium-term), specifically, the JVM 104 illegal Argument Exception.  I did not any changes to the code in > 3 months, my last run of the application on the Simulator was a week ago.

    This is where it gets crazy... If I create a new project in Eclipse using the code EXACT EVEN the above request, the Simulator works perfectly.  What could have happened to my configuration of a project that builds an illegal Exception of Argument?

    I ran clean.bat on all my simulators. The only change I made on my test machine is to install Adobe Photoshop CS5 (shouldn't really affect anything).

    All the world has already seen this problem?

    Help, please

    JRT

    Oudu a few hours and several breakpoints, I found the problem. Apparently, update a GaugeField using .setValue (int) can throw an Exception of the illegal Argument? But only once a year. I don't know why it was a problem now, the code has been stagnant...?

    SOLUTION:

    try {}

    Update GaugeField

    }

    catch (IllegalArgumentException foo)

    {

    }

    BOOYA! FTW

  • Java.lang.Illegal argument exception

    Dear Sir

    I have the below who worked after I made a few changes, I started getting this error:

    "java.lang.illegal argument exception".

    any help is highly appreciated

    Zeo package;

    import java.util.Calendar;
    import java.util.Date;
    import java.util.TimeZone;
    Import net.rim.device.api.i18n.SimpleDateFormat;
    Import net.rim.device.api.ui.Field;
    Import net.rim.device.api.ui.FieldChangeListener;
    Import net.rim.device.api.ui.Font;
    Import net.rim.device.api.ui.Ui;
    Import net.rim.device.api.ui.UiApplication;
    Import net.rim.device.api.ui.component.ButtonField;
    Import net.rim.device.api.ui.component.Dialog;
    Import net.rim.device.api.ui.component.LabelField;
    Import net.rim.device.api.ui.component.SeparatorField;
    Import net.rim.device.api.ui.container.HorizontalFieldManager;
    Import net.rim.device.api.ui.container.MainScreen;
    Import net.rim.device.api.ui.container.VerticalFieldManager;

    Home page of class extends screen
    {
    HorizontalFieldManager _fieldManagerBottom1, _fieldManagerBottom2, _fieldManagerBottom3, _fieldManagerBottom4, _fieldManagerBottom5, _fieldManagerBottom6, _fieldManagerBottom7;
    ButtonField btnSo, btnPendingSo, btnOpenTT, btnPendingTT, btnTop50So, btnTop50TT;
    LabelField lblSo, lblPendingSo, lblOpenTT, lblPendingTT, lblTop50So, lblTop50TT;
    Do police = Font.getDefault ().derive(Font.PLAIN,5,Ui.UNITS_pt);
    S ServerConnection = new ServerConnection();
    String data = s.displayData ("http://m.zeo.zajil.com/BB/Default.aspx");
    splitString spt = new splitString();
    DisplayData String().
     
    HomePage()
    {
    Thread postnameThread = new Thread (new ServerConnection());
    postnameThread.start ();
       
    LabelField title = new LabelField ("Zajil BlackBerry Edition", LabelField.ELLIPSIS: ") LabelField.USE_ALL_WIDTH);
    setTitle (title);
       
       
          
    HorizontalFieldManager _fieldManagerTop;
    VerticalFieldManager _fieldManagerMiddle;
       
      
    _fieldManagerTop = new HorizontalFieldManager();
    _fieldManagerMiddle = new VerticalFieldManager();
    _fieldManagerBottom1 = new HorizontalFieldManager();
    _fieldManagerBottom2 = new HorizontalFieldManager();
    _fieldManagerBottom3 = new HorizontalFieldManager();
    _fieldManagerBottom4 = new HorizontalFieldManager();
    _fieldManagerBottom5 = new HorizontalFieldManager();
    _fieldManagerBottom6 = new HorizontalFieldManager();
    _fieldManagerBottom7 = new HorizontalFieldManager();
      
    during the initialization of the labels
    lblSo = new LabelField (new LabelField ("So New"));
    lblPendingSo = new LabelField (new LabelField ("waiting So"));
    lblOpenTT = new LabelField (new LabelField ("open disturbance"));
    lblPendingTT = new LabelField (new LabelField ("pending Tickets"));
    lblTop50So = new LabelField (new LabelField ("TOP 50 SO Cust"));
    lblTop50TT = new LabelField (new LabelField ("TOP 50 Cust TT"));
       
    During the initialization of the buttons
    btnSo = new ButtonField("");
    btnSo.setFont (do);
       
    btnPendingSo = new ButtonField("");
    btnPendingSo.setFont (do);
       
    btnOpenTT = new ButtonField("");
    btnOpenTT.setFont (do);
       
    btnPendingTT = new ButtonField("");
    btnPendingTT.setFont (do);
       
    btnTop50So = new ButtonField("");
    btnTop50So.setFont (do);
       
    btnTop50TT = new ButtonField("");
    btnTop50TT.setFont (do);
       
    displayData = spt.split (data, ';');
       
    for (int i = 0; i)<>
    //  {
    btnSo.setLabel(displayData[0]);
    btnPendingSo.setLabel(displayData[1]);
    btnOpenTT.setLabel(displayData[2]);
    btnPendingTT.setLabel(displayData[3]);
    btnTop50So.setLabel(displayData[4]);
    btnTop50TT.setLabel(displayData[5]);
    //  }
       
    Officials in the field initialization
    Managers in the field to add to the Panel
    Add (_fieldManagerBottom1);
    Add (new SeparatorField());
    Add (_fieldManagerBottom2);
    Add (new SeparatorField());
    Add (_fieldManagerBottom3);
    Add (new SeparatorField());
    Add (_fieldManagerBottom4);
    Add (new SeparatorField());
    Add (_fieldManagerBottom5);
    Add (new SeparatorField());
    Add (_fieldManagerBottom6);
    Add (new SeparatorField());
    Add (_fieldManagerBottom7);
        
        
    Code to get the date current system / / start
    Calendar c = Calendar.getInstance (TimeZone.getTimeZone ("GMT"));
    c.setTime (new Date (System.currentTimeMillis ())); now
    SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
    String eventDateString;

    Calendar calendar is Calendar.getInstance (TimeZone.getTimeZone ("GMT"));. GMT will be always supported by getTimeZone
    eventDateString = sdf.format (calendar.getTime ());
    System.out.println (eventDateString);

    Calendar calendarLocal = Calendar.GetInstance ();
    eventDateString = sdf.format (calendarLocal.getTime ());
    System.out.println (eventDateString);
        
    Dim strDate = eventDateString.toString ();
    end of the code to get the date current system: convert to string
        
    _fieldManagerTop.Add (new LabelField ("* ZEO BlackBerry Main Menu *"));
    _fieldManagerMiddle.Add (new LabelField ("summary for today:" + strDate));
      
    Adding field etc.
        
    addition of high so of
    _fieldManagerBottom1.Add (new LabelField (lblTop50So));
    _fieldManagerBottom1.Add (new LabelField(""));
    _fieldManagerBottom1.Add (btnTop50So);
        
    addition of the top 50 TT
    _fieldManagerBottom2.Add (new LabelField (lblTop50TT));
    _fieldManagerBottom2.Add (new LabelField(""));
    _fieldManagerBottom2.Add (btnTop50TT);
        
    Add this field
    _fieldManagerBottom3.Add (new LabelField (lblSo));
    _fieldManagerBottom3.Add (new LabelField(""));
    _fieldManagerBottom3.Add (btnSo);
        
        
    Add on hold pending field etc.
    _fieldManagerBottom4.Add (new LabelField (lblPendingSo));
    _fieldManagerBottom4.Add (new LabelField(""));
    _fieldManagerBottom4.Add (btnPendingSo);
        
    Adding open disturbance
    _fieldManagerBottom5.Add (new LabelField (lblOpenTT));
    _fieldManagerBottom5.Add (new LabelField(""));
    _fieldManagerBottom5.Add (btnOpenTT);
        
    Added forward to TT
    _fieldManagerBottom6.Add (new LabelField (lblPendingTT));
    _fieldManagerBottom6.Add (new LabelField(""));
    _fieldManagerBottom6.Add (btnPendingTT);
        
    Adding tabs for visitors and assignments
    LabelField customersTab, AssignTab, spacer1, spacer2;
        
    customersTab = new LabelField ("Customers", LabelField.FOCUSABLE |) LabelField.HIGHLIGHT_SELECT);
    AssignTab = new LabelField ("Assignments", LabelField.FOCUSABLE |) LabelField.HIGHLIGHT_SELECT);
        
    spacer1 = new LabelField ("|", LabelField.NON_FOCUSABLE);
    spacer2 = new LabelField ("|", LabelField.NON_FOCUSABLE);
    _fieldManagerBottom7.Add (customersTab);
    _fieldManagerBottom7.Add (spacer1);
    _fieldManagerBottom7.Add (AssignTab);
    _fieldManagerBottom7.Add (spacer2);
        
    Buttons by listening to events
    btnSo.setChangeListener (listenerSo);
    btnPendingSo.setChangeListener (listenerPendingSo);
    btnOpenTT.setChangeListener (listenerOpenTT);
    btnPendingTT.setChangeListener (listenerPendingTT);
    }

    Listener for requests for new Service order
    FieldChangeListener listenerSo = new FieldChangeListener()
    {
    ' Public Sub fieldChanged (field field, int context)
    {
    Try
    {
    UiApplication.getUiApplication () .pushScreen (new ServiceOrders());
    }
    catch (Exception ex)
    {
    Dialog.Alert (ex. ToString());
    }
    }
    };
      
    Earphone for in-service control applications
    FieldChangeListener listenerPendingSo = new FieldChangeListener()
    {
    ' Public Sub fieldChanged (field field, int context)
    {
    Try
    {
    UiApplication.getUiApplication () .pushScreen (new PendingSo());
    }
    catch (Exception ex)
    {
    Dialog.Alert (ex. ToString());
    }
    }
    };
    Earphone for open trouble
    FieldChangeListener listenerOpenTT = new FieldChangeListener()
    {
    ' Public Sub fieldChanged (field field, int context)
    {
    Try
    {
    UiApplication.getUiApplication () .pushScreen (new OpenTT());
    }
    catch (Exception ex)
    {
    Dialog.Alert (ex. ToString());
    }
    }
    };
      
    Earphone for pending tickets
    FieldChangeListener listenerPendingTT = new FieldChangeListener()
    {
    ' Public Sub fieldChanged (field field, int context)
    {
    Try
    {
    UiApplication.getUiApplication () .pushScreen (new PendingTT());
    }
    catch (Exception ex)
    {
    Dialog.Alert (ex. ToString());
    }
    }
    };
      
      
    EXIT button that's will close the application...
    FieldChangeListener listenerExit = new FieldChangeListener()
    // {
    ' Public Sub fieldChanged (field field, int context)
    //  {
        
    Dialog.Alert ("thank you for using ZEO BlackBerry");
    System.Exit (0);
    //  }

    //  };
    }

    Rgds

    Nadir

    I solved it sorry for the post... It was just a stupid mistake... rgds Nadir

  • Illegal state Exception when running the code at startup

    Here's my main method:

        public static void main(String[] args)
        {
            if (args.length == 1 && args[0].equals("startup"))
            {
                Criteria locationCriteria = new Criteria();
                locationCriteria.setCostAllowed(false);
                LocationProvider mlocationProvider;
                Location mLocation = null;
                try
                {
                    mlocationProvider = LocationProvider
                            .getInstance(locationCriteria);
                    mLocation = mlocationProvider.getLocation(-1);
                }
                catch (LocationException e) {
                }
                catch (InterruptedException e) {
                }
                QualifiedCoordinates mQC = mLocation.getQualifiedCoordinates();
            }
            else
            {
                MyApp theApp = new MyApp();
                theApp.enterEventDispatcher();
            }
        }
    

    The method

     mlocationProvider = LocationProvider.getInstance(locationCriteria); 
    

    throws the illegal state exception

    When I check the debug information, I found this exception are thrown to the line when he calls Application.getApplication ();

    When I move this code to run in a normal life to screen it works fine. !

    Any help?

    There may be a number of issues here:

    (1) until your Application is actually running, you can't really do any processing.  Your Application does not start running until you

    'enterEventDispatcher() '.

    Hand, all you should do is instantiate your Application.  Manufacturer of your Application should not do anything complicated either, since it works as part of main().

    You can do some activities, for example to add listeners, in main() code that is, in some respects, unfortunate because it lulls people into thinking they can do anything.  ,

    (2) get the location as you do, is a blocking call.  If you need to do it on a background Thread.  You c a get away with that on the Simulator because GPS simulated returns immediately with a location.  So it does not actually block.  But on a real device, code as you can force your application to break.

    (3) you seem to try to do something in the commissioning.  You must be aware, this start-up up is called as part of the start-up of the device and before the unit is fully active.  In fact, I think on a real device that this code will fail because the device is not ready to provide a location in the beginning upward.

    You will find find article, informative and useful for (1) and (3).

    http://supportforums.BlackBerry.com/T5/Java-development/write-safe-initialization-code/Ta-p/444795

    I suspect you want to start and get a location at first upward, in which case you might find this useful:

    http://supportforums.BlackBerry.com/T5/Java-development/create-a-background-application/Ta-p/445226

  • By clicking on the button "return" gives illegal state exception

    Hello

    In my app, when I'm clicking on I show a dialog box. and when I am pressing Yes in the dialog box, it gives me the illegal state exception. But I want to return to the previous screen. If I'm clicking on menu and then clicking Close, and then it goes back to the previous screen. Here is my code:

    public boolean keyDown(int keycode, int time) {
    
            if (Keypad.KEY_ESCAPE == Keypad.key(keycode)) {
                int result = Dialog.ask(Dialog.D_YES_NO, "Do you want to edit the list?");
                if (result == Dialog.YES)
                {
                    try
                    {
                        UiApplication.getUiApplication().popScreen(this);
                    }
                    catch (Exception e)
                    {
                        e.printStackTrace();
                    }
    //              onClose();
                }
                else
                {
                    return true;
                }
            } // end if
    
            return false;
        }
    

    Please help me...

    Same question in StackOverFlow:

    Dear arindamhit,

    When you are clicking back into the device and then by default button the onclose() method is called. So try to do like this;

    protected boolean onSavePrompt()
    {
        return true;
    }
    
    public boolean onClose()
    {
        int choose=Dialog.ask(Dialog.D_YES_NO, "Close the screen");
        if(choose==Dialog.YES)
        {
            return super.onClose();
        }
        return true;
    }
    

    It's the best way; If you use like the one above you might get a problem; It is:

    *) If you use this method on the first screen, then according to your code when popup screen then there is no screen in the battery display (because it's the first screen); So you could get this kind of problem;

    Try this one;

  • JavaFX binding throws illegal state Exception: not on the thread of Application FX

    Hi all

    I am updating a label of a task using bindings.

    However, when I 'Bind' the label text property with a property of the task, Illegal state exception string is thrown. Saying: this is not not on the thread of JavaFX.

    The Exception occurs whenever I try to set the property of the task of the Interior string.

    Please do not suggest to use the platform. RunLater(). I want to do this through links as the values I am trying to display in the label (later on) could change too frequently, and I don't want to flood the queue of the thread of the user interface with executable objects.

    Please let me know what I'm doing wrong and what I need to change to make it work properly with links. (I'm new to links and concurrency JavaFx API)

    Here is my Code.

    public class MyTask extends Task<String>{
    
        MyTask(){
           System.out.println("Task Constructor on Thread "+Thread.currentThread().getName());
    
    
        }
        private StringProperty myStringProperty = new SimpleStringProperty(){
            {
                System.out.println("Creating stringProperty on Thread "+Thread.currentThread().getName());
            }
        };
        private final void setFileString(String value) {
            System.out.println("Setting On Thread"+Thread.currentThread().getName());
            myStringProperty.set(value); }
        public final String getFileString() { return myStringProperty.get(); }
        public final StringProperty fileStringProperty() {
            System.out.println("Fetching property On Thread"+Thread.currentThread().getName());
            return myStringProperty; }
        
        @Override
        public String call() throws Exception{
            System.out.println("Task Called on thread "+Thread.currentThread().getName());
    
    
           for(int counter=0;counter<100;counter++){
               try{
               setFileString(""+counter);
               }catch(Exception e){
                   e.printStackTrace();
               }
               Thread.sleep(100);
               System.out.println("Counter "+counter);
           }
           return "COMPLETED";
        }
    }
    
    
    public class MyService extends Service<String> {
    
    
        MyTask myTask;
    
        public MyService(){
            System.out.println("Service Constructor on Thread "+Thread.currentThread().getName());
            myTask=new MyTask();
        }
    
        @Override
        public Task createTask(){
            System.out.println("Creating task on Thread "+Thread.currentThread().getName());
            return myTask;
        }
    
    }
    
    
    public class ServiceAndTaskExperiment extends Application {
        @Override
        public void start(Stage stage) throws Exception {
            Parent root = FXMLLoader.load(getClass().getResource("Sample.fxml"));
            Scene scene = new Scene(root);
            stage.setScene(scene);
            stage.show();
        }
        public static void main(String[] args) {
            launch(args);
        }
    }
    
    
    public class SampleController implements Initializable {
        @FXML
        private Label label;
    
        @FXML
        private void handleButtonAction(ActionEvent event) {
            System.out.println("You clicked me!");
            myTestService.start(); //This will throw out exceptions when the button is clicked again, it does not matter
        }
    
        MyService myTestService=new MyService();
        @Override
        public void initialize(URL url, ResourceBundle rb) {
            label.setText("Hello World!");
            //adding the below Line causes the exception
            label.textProperty().bind(myTestService.myTask.fileStringProperty()); //removing this line removes the exception, ofcourse the label wont update.
        } 
    }
    //sample.fxml
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import java.util.*?>
    <?import javafx.scene.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.*?>
    
    
    <AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml" fx:controller="serviceandtaskexperiment.SampleController">
        <children>
            <Button layoutX="126" layoutY="90" text="Click Me!" onAction="#handleButtonAction" fx:id="button" />
            <Label layoutX="126" layoutY="120" minHeight="16" minWidth="69" fx:id="label" />
        </children>
    </AnchorPane>
    
    
    
    

    And it is the output with links on:

    Output: when the link is activated label.textProperty () .bind (myTestService.myTask.fileStringProperty ());

    Service on JavaFX Application Thread constructor

    Creating string on thread JavaFX Application Thread

    Task, Builder on JavaFX Application Thread

    Get the property on request ThreadJavaFX wire

    You clicked me!

    Creating a task on a thread Thread Application JavaFX

    Task called threadThread-4

    Setting on ThreadThread-4

    java.lang.IllegalStateException: not on the application thread FX; currentThread = Thread-4

    at com.sun.javafx.tk.Toolkit.checkFxUserThread(Toolkit.java:237)

    at com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(QuantumToolkit.java:398)

    to javafx.scene.Parent$ 1.onProposedChange(Parent.java:245)

    at com.sun.javafx.collections.VetoableObservableList.setAll(VetoableObservableList.java:90)

    at com.sun.javafx.collections.ObservableListWrapper.setAll(ObservableListWrapper.java:314)

    at com.sun.javafx.scene.control.skin.LabeledSkinBase.updateChildren(LabeledSkinBase.java:602)

    at com.sun.javafx.scene.control.skin.LabeledSkinBase.handleControlPropertyChanged(LabeledSkinBase.java:209)

    to com.sun.javafx.scene.control.skin.SkinBase$ 3.changed(SkinBase.java:282)

    at javafx.beans.value.WeakChangeListener.changed(WeakChangeListener.java:107)

    to com.sun.javafx.binding.ExpressionHelper$ SingleChange.fireValueChangedEvent (ExpressionHelper.java:196)

    at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:100)

    at javafx.beans.property.StringPropertyBase.fireValueChangedEvent(StringPropertyBase.java:121)

    at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:128)

    in javafx.beans.property.StringPropertyBase.access$ 100 (StringPropertyBase.java:67)

    to javafx.beans.property.StringPropertyBase$ Listener.invalidated (StringPropertyBase.java:236)

    to com.sun.javafx.binding.ExpressionHelper$ SingleInvalidation.fireValueChangedEvent (ExpressionHelper.java:155)

    at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:100)

    at javafx.beans.property.StringPropertyBase.fireValueChangedEvent(StringPropertyBase.java:121)

    at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:128)

    at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:161)

    at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:67)

    to serviceandtaskexperiment. MyTask.setFileString (MyTask.java:24)

    to serviceandtaskexperiment. MyTask.call (MyTask.java:36)

    to serviceandtaskexperiment. MyTask.call (MyTask.java:11)

    to javafx.concurrent.Task$ TaskCallable.call (Task.java:1259)

    at java.util.concurrent.FutureTask.run(FutureTask.java:262)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

    to java.util.concurrent.ThreadPoolExecutor$ Worker.run (ThreadPoolExecutor.java:615)

    at java.lang.Thread.run(Thread.java:724)

    Output with links removed: (label will not be updated)

    Service on JavaFX Application Thread constructor

    Creating string on thread JavaFX Application Thread

    Task, Builder on JavaFX Application Thread

    You clicked me!

    Creating a task on a thread Thread Application JavaFX

    Task called threadThread-4

    Setting on ThreadThread-4

    Counter 0

    Setting on ThreadThread-4

    1 meter

    Setting on ThreadThread-4

    2 meter

    Setting on ThreadThread-4

    If myStringProperty is bound to the textProperty of etiquette, you can only change it on the Thread of the JavaFX Application. The reason is that change its value will result in a change of the label, and changes of live parts of the graphic scene cannot be performed on the Thread of the JavaFX Application.

    Task and Service classes expose a messageProperty you could use here. The Task class has a updateMessage (...) method that changes the value of the message on the Thread of the JavaFX Application property. It also merges calls in order to prevent the flooding of this thread. If you could do the following in your MyTask.call () method:

    updateMessage(""+counter);
    

    and then in your controller just do

    label.textProperty().bind(myTestService.messageProperty());
    

    If you don't want to use the messageProperty for some reason any (for example you are already using it for something else, or you want to make something similar to a property that is not a string), you must merge the updates yourself. What follows is based on the source code of the task:

    public class MyTask extends Task {
    
         // add in the following:
        private final AtomicReference fileString = new AtomicReference<>();
    
        private void updateFileString(String text) {
            if (Platform.isFxApplicationThread()) {
                setFileString(text);
            } else {
                if (fileString.getAndSet(text) == null) {
                    Platform.runLater(new Runnable() {
                        @Override
                        public void run() {
                            final String text = fileString.getAndSet(null);
                            MyTask.this.setFileString(text);
                        }
                    });
                }
            }
        }
    
       // Now just call updateFileString(...) from your call() method
    }
    
  • Invalid Argument exception

    Hello

    Trying to send commands to the illustrator of c#. I can create a new document, draw a few simple paths/objects, copy/paste things. But when I try to do something with the Page/group elements such as change their position or size I get "Invalid Argument Exception".

    It is there no c# script reference, so I use Visual Basic one. And it has worked well for simpler things.

    Please tell me what is the problem with this code:

    illustrDoc.GroupItems[0].Top = 1.0;
    
    illustrDoc.GroupItems[0].PathItems[0].Top = 1.0;
    
    illustrDoc.Layers[0].PathItems[0].Top = 1.0;
    
    double scale = 10.0;
    illustrDoc.GroupItems[0].Resize(scale, scale, true, true, true, true, scale, Illustrator.AiTransformation.aiTransformCenter);
    

    All the lines listed above (exceptdouble scale = 10.0;", of course) throw the same exception. It's weird.

    All the layers/groups/elements are unlocked and visible.

    Thank you.

    I don't know about c#, but visual basic uses parentheses instead of brackets, and the berries of the object are 1 based... so, to access the first group, in visual basic, you must write it like this

    illustrDoc.GroupItems(1).Top = 1.0;
    
  • Illegal Argument error

    Hello (again).

    In my application, I have to do some math every time something is written on a BasicEditField, without having to press a button.

    So I added a FieldChangeListener to the BasicEditField. When I run the application and I type something in the field, it shows the FMV 104: illegal Exception of Argument.

    FieldChangeListener calcListener = new FieldChangeListener() {
                public void fieldChanged(Field field, int context) {
    
                    if (context != PROGRAMMATIC) {
                        Calculate();
    
                    }
                }
    
                private void Calculate() {
                    //.. some switch and if statements go here
    
                    }
                    double convertido = Double.parseDouble(someField.getText()) * pi;
                    otherField.setText(""+convertido);
    
                }
            };
            someField.setChangeListener(calcListener);
    

    I found that if I remove the line otherField.setText(""+convertido), then there is no exception when I type in.

    Someone knows why or how to fix it?

    The problem is that FILTER_NUMERIC will not decimals. Use FILTER_REAL_NUMERIC instead.

    Edit: of course, if make you a field read-only, then you don't need any filters to all the

  • see URLEncodedPostData.getBytes () and illegal state Exception

    Hi, expert,

    recently when I tried to understand the device encryption, I discovered my starts http grave failed when the device is locked and the encryption is enabled. After the addition of debugging information more, I finally discovered that the exception is thrown to the URLEncodedPostData.getBytes () with IllegalStateException, here is a part of the stack trace:

      IllegalStateException
        No detail message
        net_rim_cldc-11(4DE8751A)
         PersistentContent
         decode
         0x8E80
        net_rim_cldc-11(4DE8751A)
         PersistentContent
         decode
         0xB1FC
        net_rim_cldc-11(4DE8751A)
         PersistentContent
         decode
         0xB18A
        net_rim_bb_browser_lib(4DE8802C)
         URLEncodedFormData
         toString
         0xB6C9
        net_rim_bb_browser_lib(4DE8802C)
         URLEncodedFormData
         getBytes
         0xB6B2
        net_rim_bbapi_browser(4DE88041)
         URLEncodedPostData
         getBytes
         0x411
    

    Then I did some search on the forum, I found this link, and that is exactly the same as what I saw: http://supportforums.blackberry.com/t5/Java-Development/URLEncodedPostData-getBytes-and-Illegal-Stat... As I saw no explanation on this thread, I just open this post to see if there is any explanation about it.  I guess that fi that we can't work around this problem, we would have to write code ourselves url code.

    This proximity. Work of my own URL encoding code which is pretty easy to code.

  • «"" «... Illegal state exception»»» " Help!

    Here's my situation.

    I have an A screen that has a button and an ObjectListField and a button. Initially, the object list field contains a list of strings.

    What is push the button a new popup window appears, it contains a text field and a button. I use the display of the text field to get the input of the chain of the user and when the user presses the button, the precious screen containing the ObjectListField appears with the updated value.

    Here is my code

    -----------------------------------------------------------------------------------------------

    you manage the ESC but will also run great, it means that the screen is closed twice.

    put in a return after that manipulation of the ESC key should solve the problem.

  • Illegal state exception reading MCC

    Hello

    I use the method above to read MCC

    This is a good model for the treatment of the "start-up" which should mean that you can get your information from the Radio, once the device has started successfully.

    http://supportforums.BlackBerry.com/T5/Java-development/write-safe-initialization-code/Ta-p/444795

  • iLLEGALARGUMENT EXception on touch event

    package mypackage;
    
    import java.util.Vector;
    
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FocusChangeListener;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.Manager;
    import net.rim.device.api.ui.TouchEvent;
    import net.rim.device.api.ui.TouchGesture;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.XYRect;
    import net.rim.device.api.ui.component.BasicEditField;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.SeparatorField;
    import net.rim.device.api.ui.component.Status;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    
    public class PlaylistTab extends MainScreen  implements FocusChangeListener{
    
        private int _xCoord = 0; //The x coordinate for the top left corner of the image.
        private int _yCoord = 0; //The y coordinate for the top left corner of the image.
        private int _xTouch = 0; //The x coordinate of the previous touch point.
        private int _yTouch = 0; //The y coordinate of the previous touch point.
    
        private LabelField tab1;
    
        private LabelField tab2;
    
        private LabelField tab3;
    
        private LabelField spacer1;
    
        private LabelField spacer2;
    
        private VerticalFieldManager tabArea;
    
        private LabelField tab1Heading;
    
        private BasicEditField tab1Field1;
    
        private BasicEditField tab1Field2;
    
        private LabelField tab2Heading;
    
        private BasicEditField tab2Field1;
    
        private BasicEditField tab2Field2;
    
        private LabelField tab3Heading;
    
        private BasicEditField tab3Field1;
    
        private BasicEditField tab3Field2;
    
        private VerticalFieldManager tab1Manager;
        private VerticalFieldManager tab2Manager;
        private VerticalFieldManager tab3Manager;
        int tabNum = 1;
        public PlaylistTab()
        {
            super(NO_VERTICAL_SCROLL | NO_VERTICAL_SCROLLBAR);
            //HorizontalFieldManager hManager = new HorizontalFieldManager();
            HorizontalFieldManager hManager = new HorizontalFieldManager(NO_VERTICAL_SCROLL | NO_VERTICAL_SCROLLBAR | NO_HORIZONTAL_SCROLL  | NO_HORIZONTAL_SCROLLBAR);
            Font font = getFont().derive(Font.PLAIN, 35);
            tab1 = new LabelField("Songs", LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT)
            {
                protected boolean navigationClick(int status,int time){
    
                    return true;
                }
                protected void layout(int width, int height) {
                    super.layout(width, height);
                    //    this.setExtent(this.getWidth(), 60);
                    this.setMargin( ( getHeight() - this.getPreferredHeight()), 0, 0, (getWidth() - this.getPreferredWidth()));
                }
            };
            tab2 = new LabelField("Album", LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT)
            {
                protected boolean navigationClick(int status,int time){
    
                    return true;
                }
                protected void layout(int width, int height) {
                    super.layout(width, height);
                    //    this.setExtent(this.getWidth(), 60);
                    this.setMargin( ( getHeight() - this.getPreferredHeight()), 0, 0, (getWidth() - this.getPreferredWidth()));
                }
            };
            tab3 = new LabelField("Artist", LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT)
            {
                protected boolean navigationClick(int status,int time){
    
                    return true;
                }
                protected void layout(int width, int height) {
                    super.layout(width, height);
                    //    this.setExtent(this.getWidth(), 60);
                    this.setMargin( ( getHeight() - this.getPreferredHeight()), 0, 0, (getWidth() - this.getPreferredWidth()));
                }
            };
            spacer1 = new LabelField(" | ", LabelField.NON_FOCUSABLE);
            spacer2 = new LabelField(" | ", LabelField.NON_FOCUSABLE);
    
            tab1.setFocusListener(this);
            tab2.setFocusListener(this);
            tab3.setFocusListener(this);
            hManager.add(tab3);
            hManager.add(spacer1);
            hManager.add(tab2);
            hManager.add(spacer2);
            hManager.add(tab1);
    
            add(hManager);
            add(new SeparatorField());
    
            tab1Manager = new VerticalFieldManager(VERTICAL_SCROLL | VERTICAL_SCROLLBAR );
            tab2Manager = new VerticalFieldManager(VERTICAL_SCROLL | VERTICAL_SCROLLBAR );
            tab3Manager = new VerticalFieldManager(VERTICAL_SCROLL | VERTICAL_SCROLLBAR );
    
            tabArea = displayTab3();
            add(tabArea);
    
        }
        public void focusChanged(Field field, int eventType) {
            if (tabArea != null) {
                if (eventType == FOCUS_GAINED) {
                    if (field == tab1) {
                        System.out.println("Switch to Tab 1");
                        delete(tabArea);
                        tabArea = displayTab1();
                        add(tabArea);
                    } else if (field == tab2) {
                        System.out.println("Switch to Tab 2");
                        System.out.println("Switch to Tab 1");
                        delete(tabArea);
                        tabArea = displayTab2();
                        add(tabArea);
                    } else if (field == tab3) {
                        System.out.println("Switch to Tab 3");
                        System.out.println("Switch to Tab 1");
                        delete(tabArea);
                        tabArea = displayTab3();
                        add(tabArea);
                    }
                }
            }
    
        }
    
        public VerticalFieldManager displayTab1() {
            try
            {
                tabNum = 3;
                final VerticalFieldManager Content= new VerticalFieldManager(Manager.USE_ALL_WIDTH|Manager.VERTICAL_SCROLL);
                Content.setMargin(5,0,0,0);
                int mas  = 0 ;
                Vector oleg = new Vector();
                SQLManager poligs = new SQLManager();
                poligs.getSongDownload(oleg, 0);
                while(mas < oleg.size())
                {
                    Song temp = (Song) oleg.elementAt(mas);
                    Content.add(new A_Song(temp.songId, temp.songName, false,temp.albumCover,temp));
                    mas++;
                }
                tab1Manager.deleteAll();
    
                HorizontalFieldManager topManager = new HorizontalFieldManager()
                {
                    public void paint(Graphics graphics)
                    {
                        graphics.setBackgroundColor(0x00000000);
                        graphics.clear(); super.paint(graphics);
                    }
                    protected void sublayout( int maxWidth, int maxHeight )
                    {
                        int width = Display.getWidth();
                        int height = this.getPreferredHeight();
                        super.sublayout( width, height);
                        setExtent( width, height);
                    }
                };
                CustomTextBox editField = new CustomTextBox();
                int pol = Display.getWidth() / 2;
                editField.setWidth(pol);
                ButtonField button = new ButtonField("Search");
                topManager.add(editField);
                topManager.add(button);
    
                //  tab1Manager.add(topManager);
                tab1Manager.add(Content);
            }
            catch(final Exception e)
            {
    
                e.printStackTrace();
                System.out.println("------------------- ");
            }
            return tab1Manager;
        }
    
        public VerticalFieldManager displayTab2() {
            try
            {
                tabNum = 2;
                final VerticalFieldManager Content= new VerticalFieldManager(Manager.USE_ALL_WIDTH|Manager.VERTICAL_SCROLL);
                Content.setMargin(5,0,0,0);
                int mas  = 0 ;
                Vector oleg = new Vector();
                SQLManager poligs = new SQLManager();
                poligs.getSongDownloads(oleg, 0);
                while(mas < oleg.size())
                {
                    Albums temp = (Albums) oleg.elementAt(mas);
                    Content.add(new A_Album(temp.albumId, temp.albumName, false,temp.albumCover,temp));
                    mas++;
                }
                tab2Manager.deleteAll();
                tab2Manager.add(Content);
            }
            catch(final Exception e)
            {
    
                e.printStackTrace();
                System.out.println("------------------- ");
            }
            return tab2Manager;
        }
    
        public VerticalFieldManager displayTab3() {
            try
            {
                tabNum = 1;
                final VerticalFieldManager Content= new VerticalFieldManager(Manager.USE_ALL_WIDTH|Manager.VERTICAL_SCROLL);
                Content.setMargin(5,0,0,0);
                int mas  = 0 ;
                Vector oleg = new Vector();
                SQLManager poligs = new SQLManager();
                poligs.getSongDownloadss(oleg, 0);
                while(mas < oleg.size())
                {
                    Artist temp = (Artist) oleg.elementAt(mas);
                    //Content.add(new A_AddSingersFM(temp.songId, temp.songName, false,temp.albumCover,temp,-1, tb, logIn,logOut,1,0,0, Register));
                    Content.add(new A_Artisti(temp.artistId, temp.artistName, false,temp.artistPhoto,temp));
                    //  int m = temp.getSongId();
                    mas++;
                }
                tab3Manager.deleteAll();
                tab3Manager.add(Content);
            }
            catch(final Exception e)
            {
    
                e.printStackTrace();
                System.out.println("------------------- ");
            }
            return tab3Manager;
        }
        protected boolean touchEvent(TouchEvent touchEvent)
        {
            int eventCode = touchEvent.getEvent();
    
            if(eventCode == TouchEvent.GESTURE){
                System.out.println("SWIPE GESTURE");
                TouchGesture g = touchEvent.getGesture();
                int gesturecode = g.getEvent();
                int direction = g.getSwipeDirection();
    
                //gallery.setHorizontalScroll(page_two, true);
                if(direction == TouchGesture.SWIPE_WEST)
                {
    
                    if(tabNum == 3)
                    {
                        delete(tabArea);
                        tabArea = displayTab2();
                        add(tabArea);
                    }
                    else if(tabNum == 2)
                    {
                        delete(tabArea);
                        tabArea = displayTab3();
                        add(tabArea);
                    }
                }
    
                if(direction == TouchGesture.SWIPE_EAST)
                {
    
                    if(tabNum == 1)
                    {
                        try
                        {
                            delete(tabArea);
                        }
                        catch(Exception e)
                        {
                            try
                            {
                                tabArea = displayTab2();
                            }
                            catch(Exception ef)
                            {
                                add(tabArea);
                                return false;
                            }
                            add(tabArea);
                            return false;
                        }
                        try
                        {
                            tabArea = displayTab2();
                        }
                        catch(Exception ef)
                        {
                            add(tabArea);
                            return false;
                        }
                        add(tabArea);
                        return false;
    
                    }
                    else if(tabNum == 2)
                    {
                        try
                        {
                            delete(tabArea);
                        }
                        catch(Exception e)
                        {
                            try
                            {
                                tabArea = displayTab1();
                            }
                            catch(Exception ef)
                            {
                                add(tabArea);
                                return false;
                            }
                            add(tabArea);
                            return false;
                        }
                        try
                        {
                            tabArea = displayTab1();
                        }
                        catch(Exception ef)
                        {
                            add(tabArea);
                            return false;
                        }
                        add(tabArea);
                        return false;
                    }
                }
            }
            //The touch event was not consumed.
            return false;
        }
    }
    

    On the sidelines, East or West navigation events I illegalargument exception.and my page crashing.

    However, when I run the same code through the debugger it works fine. I put my debugging inside the touchevent ifs and elses togglepoints.

    And note, if it crashes and I click on an illegal argument exception... I go back to the home page and as if the touchevent function was called twice and 2 strips was skipped.

    It works fine but through debugger.any help?

    very strange, I did this and it worked

    protected boolean touchEvent(TouchEvent message)
        {
            try
            {
                int eventCode = message.getEvent();
    
                if(eventCode == TouchEvent.GESTURE){
                    System.out.println("SWIPE GESTURE");
                    TouchGesture g = message.getGesture();
                    int gesturecode = g.getEvent();
    
                    switch(gesturecode) {
    
                        case TouchGesture.SWIPE:
                            int direction = g.getSwipeDirection();
                        //gallery.setHorizontalScroll(page_two, true);
                        if(direction == TouchGesture.SWIPE_WEST)
                        {
    
                            if(tabNum == 3)
                            {
                            //  delete(tabArea);
                            //  tabArea = displayTab2();
                            //  add(tabArea);
                                tab2.setFocus();
                                return super.touchEvent(message);
                            }
                            else if(tabNum == 2)
                            {
                            //  delete(tabArea);
                            //  tabArea = displayTab3();
                            //  add(tabArea);
                                tab3.setFocus();
                                return super.touchEvent(message);
                            }
                        }
                        else if(direction == TouchGesture.SWIPE_EAST)
                        {
    
                            if(tabNum == 1)
                            {
    
                                        //delete(tabArea);
                                        //tabArea = displayTab2();
                                        //add(tabArea);
                                        tab2.setFocus();
                                        return super.touchEvent(message);
    
                            }
                            else if(tabNum == 2)
                            {
    
                                    //delete(tabArea);
                                    //tabArea = displayTab1();
                                    //add(tabArea);
                                    tab1.setFocus();
                                    return super.touchEvent(message);
    
                            } }
    
                        break;
                    }
                }
                    //The touch event was not consumed.
                    return super.touchEvent(message);
            }
            catch(Exception eol)
            {
                return super.touchEvent(message);
            }
        }
    

    I do this on tab2.setfocus (), if I call setfocus it works... but if icall it separately as it is not and it hangs. very strange

    // delete(tabArea);
                            //  tabArea = displayTab2();
                            //  add(tabArea);
    
    
    
  • EncodedImage.createEncodedImage = IllegalArgumentException

    Hi all, I'm trying to create a bitmap using EncodedImage.createEncodedImage (-);

    but it is throwing... illegal argument exception which means that the byte data it takes is of unknown format, but am collecting these data from a file .png, on the SD card in the device.

    can someone check this code and tell where mistaken?

    public void addImage(String _filePath)    {      ByteArrayInputStream byteInputStream;     InputStream iStream = null;       FileConnection conn = null;       String URI = "file:///"+_filePath;//      byte []byteStream;        // opening connection to the selected location        try       {         add(new LabelField("befor opening conn"));            conn = (FileConnection)Connector.open(URI);           if(conn != null)              add(new LabelField("after opening conn, conn estblshd"));         iStream =  conn.openDataInputStream();//          String str = iStream.toString();//            byteStream = str.getBytes();          int bytesRead=0;          int bytesToRead=1024;         byte[] input = new byte[bytesToRead];
    
              if( iStream != null)          {             add(new LabelField("before while, and iStream != null"));         while (bytesRead < bytesToRead)            {           int result = iStream.read(input, bytesRead, bytesToRead - bytesRead);             if (result == -1) break;              bytesRead += result;            }         }         if( input != null)            {             add(new LabelField("input != null"));             EncodedImage eiImage = EncodedImage.createEncodedImage(input, 0, input.length); /// error here....                if( eiImage != null)              {                 add(new LabelField("eiImage != null"));                   Bitmap bmp = eiImage.getBitmap();                 BitmapField bmpField = new BitmapField(bmp);                  if( bmpField != null)                     this.add(bmpField);                   else                      this.add(new LabelField("bmp is null"));              }
    
              }
    
              updateLayout();       }     catch (IOException e)         {         System.out.println("IOException:"+e.getMessage());            add(new LabelField("IOException:"+e.getMessage()));       }     finally       {         if( conn!= null)              try {                 conn.close();             } catch (IOException e) {                 add(new LabelField("IOException:"+e.getMessage()));                   e.printStackTrace();              }         if(iStream != null)               try {                 iStream.close();              } catch (IOException e) {                 add(new LabelField("IOException:"+e.getMessage()));                   e.printStackTrace();              }     }
    

    I found debugging, that the creation of input streams, but the error is thrown during the creation of the EncodedImage.

    Help, please...

    Try to replace

    bytesToRead = 1024;

    with

    bytesToRead = conn.fileSize ();

  • Background with custom layout error

    Hello

    I have a screen that I put to use a background image, and I created a custom presentation of HFM

    but when I use my layout on the screen I get an 104 error not caught illegal argument exception.

    When I delete the code for the background image, the screen will display properly with my custom layout,

    How can I use my custom with a background image layout.

    Thank you

    Hello

    I ran my application with debugging and here is a screenshot of the debug window when my application crashes.

    He seemed to have solved the problem now my custom layout and and background displays correctly, I changed my background don't not to scale, can someone help explain this that when wrong when using Background.REPEAT_SCALE_TO_FIT

    Bitmap VO = Bitmap.getBitmapResource ("splashscreen.png");
    Background _bg = BackgroundFactory.createBitmapBackground (VO,
    Background.POSITION_X_LEFT, Background.POSITION_Y_TOP,
    ( Background.REPEAT_SCALE_TO_FIT) ;
    VerticalFieldManager _scrMngr = (VerticalFieldManager) getMainManager();
    _scrMngr.setbackground (_bg);

    Bitmap VO = Bitmap.getBitmapResource ("splashscreen.png");
    Background _bg = BackgroundFactory.createBitmapBackground (VO,
    Background.POSITION_X_LEFT, Background.POSITION_Y_TOP,
    ( Background.REPEAT_NONE) ;
    VerticalFieldManager _scrMngr = (VerticalFieldManager) getMainManager();
    _scrMngr.setbackground (_bg);

  • Get the image using getBinary

    Hello.. I try to extract the photo of a particular contact. I can see the built application in which this image is there but not able to fetch it. His donations illegal Argument Exception. I don't get what the problem... Here's the code... Please suggest where I m wrong?

    public static byte[] getPic(Contact contact) // This is the function for fetching byte data in the Picture class
        {
            byte[] pic = null;
            if(contact == null)
            {
                return null;
            }
            if((contact.countValues(Contact.PHOTO) > 0))
            {
                pic = new byte[(int)(contact.getBinary(Contact.PHOTO,0).length)];
                pic = contact.getBinary(Contact.PHOTO, 0);
            }
            return pic;
        }
    
    if(Picture.getPic(item)!=null) // item is the contact
    {
    EncodedImage image = EncodedImage.createEncodedImage(Picture.getPic(item), 0,
                            Login.getPic(item).length);
    }
    

    The createEncodedImage function does not work. I tried createBitmapFromBytes also. But who does not work too.

    Please suggest a solution.

    Thanx

    Drom the API documentation:

    "Note that the javadocs for addBinary(), setBinary(), getBinary() , and all say that binary data must be coded"into a string of 'B' binary code as defined by [IETF RFC 2047]". This means that the photo data returned by getBinary() will be coded in Base64. Also, the data can be specified to setBinary() and addBinary() in two bytes raw or encoded in base 64; If the raw bytes are specified then they are converted to Base64. To encode or decode Base64 data you can use Base64OutputStream or Base64InputStream, respectively. »

    In others, you will need to cancel first Base64 encoding.

Maybe you are looking for

  • ios10 - can not go beyond the lock screen

    I'm updating my iPhone 5SE yesterday.  It is already planted on the lock screen 3 times requiring a reset, that is to say press power and home for 10 seconds.  I've owned iPhones for many years and has never had to use the front reset feature. My con

  • Unable to bookmark Web sites/pages

    All your Favorites options do not work. Right click on the page to select the bookmark this page double clicking Gold Star and clicking on bookmarks in the task bar to save are examples.

  • Not sure about the difference between Lenovo series

    Hey guys, I intend to buy a laptop for daily use soon and many portable computers cought Lenovo my eye (especially for their full ips hd and touch screen), but There's something that confuses me on their brand image, what is the difference between: Y

  • Dinner Dash 2

    Close unexpectedly in the middle of the game when playing, error message indicates a problem causing to cancel the program. This can be corrected?

  • Error 1935 when running in W7 computer installation

    Hi all I am trying to install a program by running its Setup program on a PC slot on W7. Same part 1 of 97 in the installation I get again and again the following error: «The VC2005MSMs OR x 64 installation failed with the following error: Error 1935