×

Discussion Board

Results 1 to 2 of 2

Thread: Slider issue

  1. #1
    Registered User
    Join Date
    Feb 2013
    Location
    Madrid
    Posts
    84

    Exclamation Slider issue

    I'm writing a J2ME with LWUIT using the SDK 1.0 to the Nokia Asha devices.

    In my interface, I'm adding a Slider Component but when I set the min, max or the progress I get this error

    Uncaught exception: java.lang.IllegalArgumentException: Slider minimum value must be less than maximum value

    It has no sense for me because my code is the same that I was using in a S40 app and the slider works fine.

    Here it is

    Code:
    heightContainer = new Container(new BoxLayout(BoxLayout.Y_AXIS));
                heightLabel = new Label("Altura: " + 1.50 + " m");
                heightLabel.setUIID("DataLabelContainer");
                heightSlider = new Slider();
                heightSlider.setEditable(true);
                heightSlider.setMinValue(100);
                heightSlider.setMaxValue(299);
                heightSlider.setProgress(150);
                heightSlider.setIncrements(1);
                heightSlider.setInfinite(false);
                heightSlider.addDataChangedListener(new DataChangedListener() {
                    public void dataChanged(int index, int value) {
                        double i = Double.parseDouble("" + value);
                        height = i / 100;
                        heightLabel.setText("Altura: " + height + " m");
                    }
                });
                heightContainer.addComponent(heightLabel);
                heightContainer.addComponent(heightSlider);
    Any idea?

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,570

    Re: Slider issue

    Without knowing the API, I would just accept the message. Then try setMaxValue first, and then setMinValue.
    While trying to get some knowledge about the API, I read the documentation which has "The slider defaults to percentage display" near to the very beginning. It may easily imply that default maxvalue is 100, and a setMinValue(100) indeed not less than it.

Similar Threads

  1. QML and Slider
    By mark090480 in forum Qt
    Replies: 6
    Last Post: 2012-12-13, 11:16
  2. Slider Bar
    By vicott in forum Symbian User Interface
    Replies: 6
    Last Post: 2009-09-28, 17:18
  3. nokia n95 buttons from music slider issue
    By shadow-2005 in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-02-25, 11:40
  4. Get a slider's value
    By ortiv in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-11-26, 11:04
  5. Replies: 1
    Last Post: 2003-11-03, 12:34

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •